> If anything this used to be much more common before the era of codes of conduct, when people were, for example, routinely fired when it was discovered that they were gay.
Your comment is a bit cryptic, but I assume you're trying to make an equivalence between, say, someone being fired for being gay in the 1970s and someone now being fired for saying hateful things about trans people. These scenarios are only comparable at a level of abstraction that's not useful. It's only inconsistent to oppose one thing and not the other if you think that employers should be barred from firing people for anything that they say or do outside of work. I don't think there has ever been a society where this was the norm. Looking at the big picture, people nowadays have far more freedom in this respect than they ever did (e.g. women are not fired when they get married).
There's a lot of overlap between those two categories, so I'd assume about the same number. But like many others in this thread you're choosing to make your point in a cryptic way. I'm sure you know that statistics on this aren't available, so what is the point that you really want to make here?
Do we really want to go back to those times?