Yeah, people often forget that human like robots are shit in general. A flying drone is a lot more efficient at delivering a grenade than a running mech.
Robots have a very limited scope of their functionality compared to animals. Legs are good when you have to perform loads of different tasks to survive: chase, hide, climb, tear flesh apart, etc. A robot which only needs to deliver a grenade to an enemy doesn't need to do anything like that.
Cause we don't have the technology to make good legs? Nature evolved legs cause they're simply better than anything else, that's literally what evolution is.
The battery tech is getting pretty good where exoskeleton can be quite small but still very useful. Being able to run a lot without losing fighting capabilities for a soldier is still an incredible advantage.