This has been said many times and this is not a bug but a feature...

Historically a man in a Phalanx would be trying to get protection from the shield of the man to his right from missiles, so a Phalanx did have a natural tendancy to slide to the right as men bunched up.

This also helps explain why in ancient warfare a tradition was developed (from classical times) that the best units were always placed on the right, this is because in Hoplite warfare they would see combat with the enemy first.