Why do the C-141 and C-5 have T-tails?
It comes down to a matter of philosophy. Or, if you are less generous, it’s a matter of fashion. Note that the Russian equivalent to the C-141, the Il-76, uses a T-tail, too, while the An-124 uses a conventional tail.

T-tails were in fashion in the early jet age. They were widespread, first in fighters and later in transport aircraft, too, because they:


Have a longer lever arm when placed on top of a swept vertical, reducing tail size and mass,
Allow for a smaller vertical tail due to the endplate effect, which lowers the requirement for hangar doors and ceilings. In case of the A400M, the T-tail allowed for a height reduction of approximately 2 meters.
Stay in undisturbed flow during stall. With wing-mounted engines resulting in a more forward wing position, the danger of a deep stall is reduced when compared to a configuration with tail-mounted engines.
Allow for less interference drag, especially when combined with a Küchemann body in the intersection between vertical and horizontal tail.


Therefore, if your conceptual design team is dominated by aerodynamicists, it will tend to favor the T-tail version. Only when second-order effects are considered will the conventional tail win. And those second-order effects will only become known by experience.

What are those effects?


Flutter! The rear loading ramp requires cutting the rear fuselage open, reducing its torsional stiffness. Add to that a mass on a long lever arm (the horizontal tail) and you get a structure with a very low eigenfrequency. In order to get that frequency out of the usable speed range, you need to stiffen the fuselage,
which adds structural mass. Both tail surfaces might be smaller for a T-tail, but the whole aircraft will be quite a bit heavier. During flight test of the C-141 it was found that the antimetric wing bending mode would nicely couple with the torsional Eigenmode of the the tail, resulting in some scary footage. Also, a coupling between elevator rotation and horizontal tail torsion required to generously add mass balance to the tail.
And then there still is this lingering suspicion that you might get into a deep stall. However, with the long distance between wing and tail of a configuration with wing mounted engines this is less of a threat than it might seem.
A real problem, however, is the tendency of a T-tail to produce a strong nose-down pitching moment in a sideslip. A low tail will eliminate this effect.