Here’s an old thread I started about this (it says poll, but polls were broken when I made it):
Discrimination in fiction is something that I think is often handled badly. First, there’s the trope of “oppressing the elves”, where some group (mages, mutants, faeries) are the group that’s discriminated against - the author wants to write about oppression, but not real-world oppression.
This is either done to show that the fantasy/sci-fi world is more enlightened (“we have moved beyond the simple skin-color based prejudices of your era”), or to avoid offending anyone and simplify research (“I know nothing about black history, so all humans are exactly the same, and I’ll make up new history for the elves.”) It fails on several levels, not least because the new oppressed group often has a good reason to be feared: gay people can’t start fires with their minds. When your minority metaphor is inhuman, mutated, or superpowered, it inevitably echoes back unpleasant tropes about human minorities being different or dangerous.
Another problem is adding real-world discrimination, but making it part of the backdrop: it’s there to add some color to the setting, not something you can interact with. I was pleasantly surprised when, in Dragon Age: Origins, I could give money to a beggar without expecting a reward, which made more beggars ask me for money. In many games, not only can’t you do anything to help, you can’t even talk to people on the street. They’re props to demonstrate How The World Is.
Another thing that happens is that discrimination is a big part of the story, but it’s introduced slowly to a character who knows nothing about it, like you’re adjusting a normal person to Wonderland. The lead is straight, white, rich, or otherwise not-the-subject-of-this-story. They must rely on minorities (which may be either humble and friendly, or hostile but helpful anyway) to teach them about their problems. Then, the outsider main character is the one to come up with the solution anyway.
I’m experimenting in my game with adding intersectionality to the oppressed monster trope; if you’re a queer vampire and someone irrationally hates you, you’re never quite sure which thing they object to. We’ll see how it works out.