Part of me seems to be stuck in the fifties, so I absolutely agree with you about this old social etiquette. It should still be in place.
Mind you, I'm a girl and I unfortunately can't pull off most of the vintage hats I would like to wear, if given the chance. That said, though, I did go through a hat period, in my last year of high school, and I always took it off inside small areas, like whenever I entered the classroom, and I always took my hat off whenever we said morning verse (which was kind of like a prayer, but non-religious), and whenever we sang the national anthem, or recited anything, etc. It's just basic politeness.