Technically speaking, mecha might make sense from a military perspective if they a) were designed to operate primarily or entirely in space, and therefore didn't have to deal with the same targeting profile and structural integrity issues they do on land/in a planet's gravity well, and b) had a direct (psychic or datajack) link to their pilots allowing the pilots to translate their familiar human actions into a larger scale and in hard vaccuum.
Either a) or b) taken in isolation makes them at least theoretically viable for some tasks. The two taken together make them possibly the best choice.
Add in cultural factors (traditions of martial arts and single-pilot military vehicles, for example, perhaps with warrior-aristocrat tendencies) and sufficiently advanced science and you have a potentially believable mecha-equipped future.
Ironically, using 'mecha,' such as they are, is one of the handful of things in Evangelion that makes sense in light of the backstory.

Of course, the 'normal infantry weapons scaled up for EVA use' doesn't, so it's all good. Most mecha conspiracy/giant alien mecha series fall into the 'makes a certain sort of sense' category to one extent or another; the mecha is the product of super-science far beyond normal military equipment, often designed to deal with opponents immune to long-range attacks, often on the basis of alien tech.
Standard Battletech-style walking mechs as the main weapons of the military, on the other hand, make no sense at all. They're ranged-weapon focused, (comparatively) lightly armored, vulnerable, physically improbable walking tanks that should be inferior to normal tanks in every way.
Of course, they're still pretty COOL, but...
