I believe it is related to your encounter settings. Units set to Aggressive will ignore the fact they have fortifications and charge the enemy immediately. Units on Normal wait two turns, and on Defensive wait four turns. This is just a hazy recollection, though. If the other side is all archers, things may get unpredictable, as there is some special code to deal with that, and it's not a common situation.