People always say things like that, but I'm guessing that it is mostly rationalization. Because at various times, military men have had everything from shaved heads to long hair braided or tied back. And nobody's ever made a solid connection between the military hairstyle and unit performance.
I think the choice of hairstyle is pretty arbitrary. The important thing is not the specifics of the hairstyle, so long as there is a particular style chosen for the military. The point is the same as having soldiers all dress alike - to make them uniform. If they all have that similarity, they feel more tightly bonded into a group, and work together as a unit. Hairstyle isn't about the mechanics of war, it's about the psychology.