Most spaces where these robots would be used are designed around the very vertical anatomy of human bodies. So the machine would have to be roughly as tall as the average person and roughly as wide. Most humans as a rule of thumb can reasonably comfortably operate on a 36 inch base (even less) and can reach as high as 6ft 4 comfortably.
It makes sense to build something that would operate in those environments. Also these machines would likely have to operate and work side by side with humans, in which case mimicking human anatomy would make interaction with them easier.
Stairs and doors.
These robots are meant to operate in environments designed for humans. While you can build wheel and tread systems that can likely navigate some elevations, they won't have the sheer adaptable flexibility of legs (whether bipedal or quadrupedal or whatever).
Bipedal robots are stupid for military applications, but if you need them to work in spaces designed for humans, it's better than most other options.