There are no advantages to legged battle vehicles. Such top-heavy combat machines on legs would be doomed to instant and terrible failure in the "real-world".
All those joints, and digits would fail sooner rather than later, and would be incredibly vulnerable to enemy fire (imagine an AT-TE stepping on a mine, or walking into a trip-wire). Furthermore, both machines have a very high profile on the battlefield, and make excellent targets (especially those nice joints).
A very sought after quality of main battle tanks, scout vehicles, and APCs alike is a low profile such that they can more easily hide behind terrain features (because you'd rather that enemy fire hit the pile of dirt you're hiding behind, not your vehicle).
It's also good to note that vehicles are typically specialized. Not too many main battle tanks (one that I know of) are capable of carrying and deploying troops - that's not their purpose! They're meant to be heavily armored, and fight other tanks! And no matter how much armor they carry, there's always a weapon that can take them out, because they can only carry so much armor. APC's on the other hand are far more lightly armored, and are meant to protect troops from small arms fire, maybe some light artillery (shrapnel), or chemical threats (such as nerve gas attacks).
The AT-AT, however, is supposedly invulnerable to pretty much anything the rebels can throw at it (including their big laser batteries on Hoth), strides across the battlefield in full view of the enemy, and can carry a fairly large number of storm troopers.
That's not a good design from many points of view:
- By sheer size alone that thing is a target for anything and anyone on the battlefield.
- Its center of gravity is way high off the ground, which makes it very prone to tipping over, or stumbling.
- If it trips and does fall over it has no mechanism to get back up, and it'll probably be too busted up anyway (crew will probably be dead as well).
- As for the soldiers it carries ... just imagine rappelling to the ground from one of those things while under enemy fire - it's essentially suicide!
- Every time it wants to shoot at something it needs to turn its bloody head, which pivots on a very vulnerable looking joint, and holds a crew of 3 or 4 to boot.
- The sides, underside, and back of the machine are utterly defenseless. Doesn't Luke climb into one from underneath, and throw a grenade in? Sounds like a pretty terrible oversight to me.
AT-TE's are better designed due to a lower height, and better support base (6 legs), but they are still quite vulnerable:
- Little to no awareness of activity on your flanks or behind you.
- Slow to turn around.
- No mechanism to get it back up if it falls over.
- Great target for the enemy.
Essentially, all these things have going for them is that they look cool.
When I first watched Star Wars as a kid I was absolutely fascinated with the fighting machines the Empire deployed. I had a bunch of figurines of them, and a book with a ton of original sketches, and explanations as to how they work, etc. Every detail of their technical abilities was explored.
However, as a budding engineer, it soon hit me that most of it was horse manure. These vehicles and their capabilities were envisioned by artists. They were meant to inspire certain feelings and emotions, not make sense from a militaristic point of view.
For example, the X-Wing design allows us to see the pilot, and the uniform design shows their faces. To the viewer they're human. Whereas the TIE fighter pilots are not visible inside their ships, and even when shown, remain faceless minions.
The idea behind the AT-ATs, was that they are large, monstrous machines which inspire dread, and communicate just how powerful and intimidating the Empire is.
When you realize that that's their real purpose, you understand why they look like they do.