In my last company (before I retired) we had a chief pilot who was a bit of a stickler about the wearing of hats. Imagine his chagrin when the management introduced a new uniform and decided that hats would not be worn nor would they be issued. I don't think he ever totally recovered from the shock. Mind you, as someone has already said, the hat was a useful receptacle for holding your car keys, ID Card etc etc on a layover.