Maybe if this were the 70s, but this is 2021 and wearing a hat indoors is perfectly normal/acceptable.
It signals that you are uncomfortable, that you intend to leave soon, essentially that you don't enjoy being here with me.
I remember some people being quite insistent that I should take my coat/jacket off, they say something like "make yourself comfortable" but I understand it more as a polite way of saying "take off your coat, you asshole". I guess the same can be said of hats.
Interesting. Never in a million years would I have taken that meaning from it. I would just think that the person is cold.
Besides, the rules about wearing a hat inside can be quite complex: women have to wear a had while men have to take it off (traditional church service in Europe); high ranking men wearing their hats, while lower ranking men have to take them off; petitioners removing their hat in front of the benefactor ...
A hat signifies status. Consider the top hat - it signifies wealth. Or the general's hat - think of Wellington and Napoleon. They signify authority.
It's inappropriate to walk into someone's parlour as a guest, while disporting the mark of your superiority. Baring your head signifies humility. It's just polite.
In the past, maybe. I don't think it does so much now (at least in my part of the US). If it signifies anything besides aesthetics, it's signifying that the person is part of some defined group. Status doesn't enter into it.
> while disporting the mark of your superiority.
So, keeping your "low status" hat on would be OK? (I'm assuming that there is such a thing -- that some hats are "high status" implies that there exists the opposite).
Baring your head is the sign of humility. It doesn't matter which hat you have to doff.
In the UK, a "low status" hat would have been be a flat-hat, or flat cap. It used to be a worker's hat; it was also worn by countrymen - farmers, country landowners, gamekeepers and the like - but not in town.
Nowadays I often see expensive tweed flat-hats on the heads of fashionable, well-to-do townies. To me, that look is poncey.
Romans mostly didn't wear hats.
Jewish men have worn the kippah (small hat) essentially all the time for much of that period. Especially indoors, in a synagogue. It's a symbol of respect for God.
The "take the hat off indoors but always wear it outdoors" certainly hasn't been universal in western Europe for the last 4000 years.