I’ve not had much to do with DW’s books myself, but kids’ literature having problematic characters is surely useful for teaching them messages in a subtle way. When I was little and reading all the Enid Blyton books (my god, I loved her), my mum made sure to point out the ideas, attitudes or characters that were definitely not appropriate and we talked about how general views change and develop over time. It was super educational for little me.
DW has done fantastic work with The Boy in the Dress, and as so many of you have already said, anything that gets kids reading (particularly boys) is to be applauded IMO.
Besides, people are going to be dickheads and have awful views, unfortunately. It might be a good thing to come across unsavoury ideas in fiction form first, so that you can discuss the issues at hand. I just really take issue with the idea of condemning/blacklisting books.