They weren't, I'm not sure where do you take that they were surprised by the attack from the south.
Before the battle begins we see them reinforcing the southern door and they are also aware that the force attacking from the south is much smaller (Sam mentions to Pip before the battle that the attacking force from the south is much smaller so they are lucky to be manning the southern wall instead while trying to calm him).
The only face of "surprise" comes from Allister Thorne when Janos Slynt shouts to him "they are attacking the southern gate" right before the attack from the north starts and his response isn't a "what?" like if he was surprised that they weren't expecting the attack at all, but a "now?" because he was surprised that the southern attack began before the northern attack. They were probably expecting the southern attack to begin after the northern attack begins so that Allister was up in the wall while it started for troop morale reasons and then going down before the southern attack begins so that he could be present there for troop morale reasons too (we even see he had a small speech ready for the brothers at the bottom before the melee starts).