Then, if you're a bloke you take your hat off in church, but put one in a synagogue. In a mosque you take your shoes off, but I 'm not sure about the headgear rule. But then if you're a bishop you put your hat on in a church...
And do vehicles count as indoors or not?
These things get pretty complicated.
The more interesting thing I think is, why did that weird fashion for men not to wear caps or hats that sprang up half way through the last century. Look at a photo of a crowd, and you can normally instantly tell its rough date on the basis of the headgear. Even on a freezing cold day the poor buggerstand around with their ears turning blue, and losing they say one third of their body heat in the process.
And then for no reason, it swings around, except that this time it's those bizarre baseball caps instead.