The A340 was built before ETOPS was created to allow two-engine planes to fly over-ocean long-haul:
* https://en.wikipedia.org/wiki/ETOPS
Once two engines were found to be reliable enough (with sufficient contingency planning) then >2 engine planes (including three-engine like the MD-11) were not really needed.