There are a few ways the aircraft engines can be mounted on the centerline, each with its advantages and disadvantages.
Image from Stanford University.
One way is to mount them as in DC10, with engine above the fuselage; another one is to use a 'S' shaped inlet and put the engine at the aft of the fuselage like Dassault Falcon 7X.
The main advantage of mounting the engine as in DC10 is that the inlet distortion is minimized and there is no need to cut a hole through the fuselage for putting engine. The main disadvantages are that it increases drag (slightly) and engine maintenance is a mess.
Apparently,the DC10 engineers tried to put all three engines in the wing during design, but were not successful.
Engines mounted in high thrust line like DC10 and Piper PA47 are highly stabilizing as increase in engine thrust causes a pitch down motion as the thrust is increased. This is usually disconcerting to the pilots, who expect the aircraft to pitch up while engine power is increased.
Finally they ended up adding design changes to correct this in PA47 (to make it pitch neutral).
In DC10, a combination of underwing and high thrust line engines would've most probably caused no pitch changes at all. So I guess the main advantage is reducing inlet distortion.
As MD11 was developed from DC10, it simply inherited this design.
Note: As for the pitch down moment being disconcerting to the pilots, it is better if someone corroborates it. It is simply that most aircraft don't do this.