Whenever I think about this one, I come back to the idea of a fun tax.
I honestly don't care that a historically or genre accurate setting would marginalize everybody except cis, straight, white guys (usually rich ones). Those descriptors don't cover all the gamers setting at my table.
So why should queer gamers, female gamers, minority gamers, trans gamers, etc. have to put up with either playing a cis-het white dude to avoid 'realistic' prejudice or put up with their character being harassed?
In essence, this adds an extra burden those gamers must bear to enjoy the game. It's a levy on fun that is only leveled on people who are not the 'typical' gamer. And that's not fair, to me.
So I tend to make settings (and this is why I use my own settings, 99% of the time) where those problems are either non-existent or the people who have them are considered strange and distasteful, rarely heard from and always assumed to be wrong. Even in my historic settings.
Because sexism, racism and homophobia aren't required to enjoy steampunk or ancient Rome or high fantasy. We're just conditioned by the media from which those settings spring and game designers' own assumptions to accept that.
We're gamers. We accept FTL, strong AI, magic, vampires, dragons and superpowers as part and parcel of the gaming experience. As givens, even in 'historic' games, a lot of time. If we can accept those, we can damned well accept that prejudices can be overcome. Even erased.
At the end of the day, I game with my friends. And I am not going to add to my friend's social burdens by not allowing them to forget, for a minute, that the real world has those problems.
If they want to assume that burden, as a group, we'll talk about it. (Though as a queer gamer myself, I usually only want those elements in my game if they are doing something, not just there because they are there.)
But for me it always comes back to that concept: the fun tax. Should there be a extra burden for gamers like us? And at my table, the default answer to that is no.