Author’s vision comes first. If they want to create some egalitarian setting, I certainly wouldn’t tell them not to. Now, whether or not I’m going to like said story depends on how they go about it.
Obviously if it’s supposed to be historical (and not alternate timeline “historical”), then I’d prefer it to be more realistic. Anything else is fair game.
They don’t necessarily need to go into too much background of “how things got the way they are” they just to remain consistent or maybe even point out “anomalies” when they occur.
(Like, “While these sorts of attitudes among humanity were generally left behind after the cataclysm of 2105, they unfortunately still rear their ugly head from time to time”)
Personally, I don’t avoid it in my stories though how much it’s playing a part anyway (And it’s never been the sole focus), really depends on the setting I’m going for.
If it’s a scifi or fantasy setting, it’s usually easier since you actually have other races running about. So usually “racism” is taking a different form than the real life skin color one.
This can still range from low (A multi-racial empire and all sorts are living together, but due to differences, certain negative attitudes are still going to occur) to extreme (Humanity has united together to be bigots towards other fantasy/scifi races and probably vice versa)
As far as humanity goes in general I usual have stuff like women fighting on the frontline along side men and nobody is really batting an eye if someone’s gay or not, but that’s about as far as I go as far as making an “egalitarian” society is concerned. I don’t really make a point of saying certain attitudes are eliminated altogether, (in fact they may still be somewhat common in certain areas), it’s just more of a case that they aren’t the focus of the story and it only matters if it becomes part of a plotline or something.
Now if it’s a modern or “real world” setting, then it still matters where the story is taking place. Usually though, I’m writing about criminals and similar types so the characters’ sensitivity towards others isn’t usually a top priority so I’m definitely not avoiding bigotry in those instances, but again since I’m not focusing on that as the main point of the story, it’s more of a case that it’s just one aspect of the character’s personality.
One thing that I think is more interesting is to have a multi-layered bigoted character anyway regardless of the setting. Since just like in real life you can meet someone who freely just uses language that would be considered bigoted to some, yet surprisingly doesn’t really hold any extreme personal prejudices against any particular group.
So you could have a character that may still think elves are a bunch of lazy hedonistic tree huggers and refer to them by various slurs, but he still goes out of his way to save one from getting eaten by troll.
(In such cases, the character probably isn’t so much of a hate filled bigot as he is a general insensitive dick.)