Wow, an old topic back in action...
I've always felt that the rear bunker that was attacked was very lightly defended, and that the brunt of the "Legion" the Emperor spoke of were at the main shield generator.
You can tell just by the explosion of the generator (And the shots of how cavernous the power grid to it was) that the whole Imperial property was HUGE. We're talking literally MILES and MILES of base probably.
It's likely that the backdoor the Teddy Grahams showed to Han and company was a legitimate surprise to the Empire that the Alliance knew of it, and attacked there.
PLUS, we have a whole slew of Rebels who came with the group but who aren't present... I've also theorized that they're at the main base causing a bit of a disturbance at the same time Han and Co. attack the rear entrance.
A small backup group is called in for the backdoor attack while the main force stays at the main base protecting it from a possibly larger frontal assault because the Imperials are kind of in the dark on what's going to happen. The AT-AT's likely patrol the cleared out area up towards the main base where they're best suited, and AT-ST's handle anything away from the cleared out forest since AT-AT's would be rendered somewhat ineffective... Not really, but they're just not suited to that kind of combat.
What the Empire doesn't expect is the Teddy Grahams which throw everything into chaos basically. And one officer's stupidity opens the door for Han when he hops in the AT-ST, and voila... The mission is won, basically.
It's a bit of a mess, just like the space battle, but it's still accomplished.