I'm no chicken expert (other than liking them fried), but supposedly it has something to do with keeping their vision steady to help them pick out any threats, such as from hawks or other predators. Movement is more easy to discern when the overall "picture" is steady. Something like that anyway. I think some research has been done on pigeons doing this.
On the opposite hand, some raptors keep their head steady even as their flying or diving, almost as though they had a built-in gyroscope. This help them pick out any movement of prey.