My take on this issue is that works of fiction operate according to the biases and assumptions of the author. If an author believes that all lawyers are lying weaselly ambulance chasers, then that's how every lawyer who appears in their novels will act. Or to use an all too common example, if an author's just gone through a nasty divorce then their next book is likely to have an ...uncharitable depiction of women and the institution of marriage.
This is important because art tells a story, and we learn from those stories, and use them as inspiration for how to live our lives. And if we're not paying attention to the biases and assumptions that art is operating under then it's easy to learn the wrong lessons. Just look at how many cults and fringe political movements use novels illustrating the world as they see it as a recruiting tool.
So step one is awareness. If you don't know what baggage the author is bringing, you can't make an informed decision about it. Step two is weighing how much negative impact the author's baggage has. Partly it's a question of how central it is to the work of art, partly it's a question of how much distance in time we have from it, and partly it's a question of how close to home it hits for you personally.
What separates D&D from Harry Potter is that D&D has been through a lot of hands over the years, and each hand has laid its own mark. We're decades past the Harlot Table, and most of us are playing a very different game now. Meanwhile Harry Potter is very much still in its original creator's hands, and with her regressive social attitudes in mind you can see them stamped all over the books. Better minds than mine have examined this at length.
The decision on what can be read with an "Of Its Time" disclaimed and what should be discarded is a collective judgment of personal choices. Everyone has to decide on their own, and the weight of popular opinion tips the scale.