As far as I can tell, all phalanx units on a wall are forced into using their secondary weapon, which generally sucks. The only phalanx unit I have seen stand up well on a wall is spartan hoplites. Apparently it applies to the attackers as well as the defender.