Because the A.I. is evil and always sends enemy units on two sides.If you don't want them to pass you, kill them when it's your turn. If you're not strong enough to kill them, why would you be able to block them?
I suppose you could say "well, double your garrison"
That's too expensive to be practical.
I forgot to stipulate - not only will you have barbarians approaching you from multiple sides for a single unit but you will get them on multiple fronts simultaneously.
If you build phalanxes and pikemen the A.I. will figure it out and stop sending mounted units.
The fun really ends when you start facing barbarian swordsmen.