Be very wary of stories about “practical” reasons for cultural rules and taboos. People love to come up with them because they’re easier to grasp than the idea that said rules came about for ideological reasons.
Like, on AskHistorians we get the question about why men stopped wearing hats in the 1960s all the time. I answer, every time, with “casualness was becoming more and more valued through the 20th century,” and there are always people who want to hear that e.g. it’s really because men were driving cars that were too low for them to wear hats inside, or because the primary purpose of hats is to protect you from weather and with more personal vehicles you didn’t need that protection.
There are no periods of fashion history when women’s clothing was so restrictive that they couldn’t pull chairs out from a table, sit in them, and/or scootch in. (If they “literally couldn’t bend over” then they wouldn’t be able to sit down at all!) Showing deference and giving personal assistance to women, particularly those considered “ladies”, was historically a marker of gentility in men; pulling out a woman’s chair was simply one way of doing this. The same thing applies to holding doors open. We can trace it back to ideals of chivalry in the Middle Ages, but really the modern version is in large part due to social changes in the eighteenth century, I think, when the idea of showing your virtue by being kind and affectionate to women became more in vogue than displaying patriarchal authority.
Taking off a hat inside likewise is a show of respect because … people decided it was a show of respect. You wear a hat outside, in the public world; you take it off in private. Crossing the boundary to take off a hat in a public space of some kind therefore signals something - it’s lowering, not quite demeaning, but it makes you vulnerable in a way that is similar to but not the same as taking off a helmet in a dangerous situation. It shows humility, whether to religion or to officials or to people you’re asking for help from. (Gender also plays into this too, since women have not historically been required to take off their headgear inside, and in some periods have been expected to keep their hair at least nominally covered at all times.)
Keeping your elbows off the table likely also goes back to eighteenth-century shifts in what was considered appropriate. Physical self-control was a huge part of what was considered good manners - sit still, stand straight, arrange your arms and legs gracefully, don’t yawn at people, don’t scratch yourself. By only placing your wrists on the table, you would be showing a decorous restraint and control of your own body, placing you above working-class people with “cruder” habits.
If you want to better understand the history of manners, I would recommend the book Bowing to Necessities: A History of Manners in America, 1620-1860, by C. Dallett Hemphill. The first section deals with 1620-1740, a period where manners mostly related to showing deference to those above you and authority to people beneath you; the second is 1740-1820, which was characterized by more open affection to youths and women; the third is 1820-1860, the rise of middle-class etiquette books.