It's easier to swap weapons when you have limbs. It's also easier to use improvised weapons when your weapons break. Also less training for an operator to use a humanoid robot than to operate a trolley with 3 or 4 turrets.
Modular weapon systems > having to build giant sized guns and knives to hold in your giant robot hands (IMO). Also, the Main Battle Tank has been pretty effective at what it does and it looks nothing like a humanoid robot.
Going out of the way to make a giant robot look like us seems like such a waste of resources. I can understand wanting to make a 'walker' type vehicle, but wouldn't it be far more practical to just make a walking tank than to try and make something look human except 15 - 20 times larger?