Why was the A340 developed with four engines? The predecessor to the A340 program begun in 1982, when Airbus released the first specification of the designated TA9 and TA11 programmes and in 1986 the TA9/TA11 programmes were officially launched as the A330 and A340 development programmes. 
By 1986 Airbus, with their 310 aircrafts, as well as Boeing, with their 757/767 aircrafts, already had twin-jets flying under the ETOPS90 and ETOPS120 rule, introduced in 1985. 
Meanwhile Boeing presented the predecessor to the 777 programme, the 767-X ("enlarged" 767) in 1986, but due to customer demand launched the clean sheet 777 twin-jet programme in 1988.

Reading up on that history, I wonder why Airbus did not opt to redesign the A340 with two engines, rather than four. 
I judge, that by the mid-80ies, the feasability of two engines for a widebody long-range aircraft with more than 300 passenger was already clear. The loosened ETOPS rules meant, that even regulators were paving the way for such an aircraft. 

What was to rationale of Airbus to develop the A340 into a four-engine airliner, while at the same time, Boeing was developing the 777 as a two-engine airliner?

EDIT:
I found another question and answer, which states that ETOPS was the reason. But ETOPS rules were introduced in 1985, while A340 development programme was launched in 1986. So Airbus made a decision despite being ETOPS already in place.
Hindsight is 20/20.

At that time, nobody could be sure the ETOPS rule would be extended the way it eventually was. The 1985 extension was a gift from the FAA to Boeing, so US carriers could use the Boeing 767 for transatlantic services. The 1989 extension to 180 minutes allowed them to cover all domestic routes with a single type when before they needed three-engined types (TriStar and DC-10) to fly to Hawaii.

Not everyone at that time was in favor of introducing ETOPS: McDonnel-Douglas said in 1984: 


  ETOPS "represents a 'totally new risk' that the industry has a limited capability to offset."


and


  "… the possible adverse consequences of premature extension of the operating limits can never be balanced by economic gain."


Especially Lufthansa had been sceptical of using two engines for long range and was a driver for the A340 development. Also, Airbus had experienced FAA chicanery before (remember that the A300 was banned for a while because of its slightly higher ground pressure loads). Airbus simply assumed that this kind of chicanery would be repeated when they went with a two-engined long range version.

That only changed when Boeing introduced the 777. Now Boeing was pressing for an ETOPS extension ("early ETOPS") and the FAA duly obliged. But that was in 1995, a full decade later and after Boeing had done extensive ground and in-flight testing, including running engines for a quarter of a million hours. ironically, the positive experience with the A320 in its first two years of operation helped to convince the sceptics of the merits of early ETOPS.