Me, I like a balance. If I'm writing a historic setting, chances are that most of the characters will subscribe to the prevailing beliefs in that time and place. Frex, Fiorenza's villagers think she's a bit odd for living alone and running her own life, but they tolerate it because they need her. The friction is there but rarely obtrusive. Not everyone necessarily agreed with society, though, so I've also got things like Hart's Farm which is basically a free-love commune in historic Sweden. I do like looking for the exceptions.
Sometimes people are horrendous, and I write about that too. I think that a key aspect of writing historic fiction, or any outside setting with very different morals, is signaling to the reader how you as the writer feel about those things. So stuff like racism, sexism, classism, ableism, homophobia, transphobia, etc. can all be portrayed with historic accuracy but without making them sound like any kind of good idea. This can be shown by having another character point out the flaws in the argument, or simply letting the natural consequences hit the jerk in the face. I find it hilarious when, for example, the snob fails to notice the black servant listening to every word, and that's how a critical secret gets out. People's bad habits really have a tendency to complicate their lives.
You don't have to sanitize the past just to make it palatable to current tastes. You simply have to think about how to portray it.
Of course, if you want a more congenial past, you can always write period fantasy or science fiction in a parallel or independent universe where things are different. I get a real kick out of certain differences in the Steamsmith, which are tied to concrete divergences explaining the slight improvements in race and sex/gender dynamics there.