Seems to go way back to the B&W movie era - men in tuxedos, women in evening gowns and boas - glamorous socialites dressed to the nines, watching a couple buys beat each other up. Sometimes the MC is in a tux. I don’t get how that whole package goes together.
If you step back and think about it, so much of human society revolves around people wearing the right costume for the occasion.
Sometimes it makes sense (protective gear, etc) other times it just seems like “that’s what we’ve always worn for X [occasion | profession | etc].”
How does removing your hat imply respect? What is the purpose for standing up when the judge enters the courtroom? Just a bunch of stupid rituals that may have made sense at one time that we keep doing for…reasons.
How about neckties - did they start as a sign of respect for authority? Analogous to a collar and leash?
Neckties follow similarly.
Fun fact, doctors used to always wear neckties. But it was found that they are great at passing on infections from one patient to another. There was backlash from the necktie wearing doctors when it was suggested they should stop wearing them. Took some time to change.
Bonus: hand washing was also rejected because “doctors are special, they can’t be dirty” (paraphrased)
A lot of men’s fashion, especially formal wear, takes styling cues from military uniforms, the modern necktie descends from the cravats by some military unit (I want to say it was some mercenaries involved in some French war, but I don’t feel like looking up the specifics right now)