That bad guys exist in the setting doesn't mean the PCs need to be the bad guys. Most stories, and D&D in particular, require conflict to function, be that conflict internal or external. This often necessitates some fictional actors who have stances which we as players might find morally unacceptable. Similarly we might want to play flawed characters, who are not morally perfect, in order to have a storyline about personal growth. Depicting unpleasant things in fiction does not automatically mean endorsing them (and usually doesn't.) To criticise a bad thing the story must be able to depict the bad thing.
I just rewatched Star Trek VI, the Undiscovered Country recently. A stellar film. And obviously wouldn't function at all without the hatred and mistrust between the Federation and the Klingons, and personal animosity Kirk felt, that he had to overcome. The film is very much about prejudices being bad, but to tell that story, it needs to actually show those prejudices and the bad outcomes they lead to. I don't even understand what sort of bland stories where nothing negative can be depicted people here want to tell.