Sometimes people write books, or make movies, or video games, or paintings, or any number of things with a message. Sometimes due to poor execution this message is misinterpreted (or interpreted as written – which is poorly). This isn’t about that, this is about intentionally writing a work with a message you disagree with. Not to lampoon it, or point out its flaws as satire does, but an attempt to earnestly argue for the other side. Call it Devil’s Advocate by Art if you will. Another way this could happen is if the artist recognizes that a subplot sends a bad message, but decides to throw it under the bus for the more central, important message. Or maybe they recognize the bad Aesop, but decide that the actual story (or camerawork, or color choice, or whatever) is more important to them than what people take home from it.
Basically, the artist recognizes that their work says something terrible, or that they don’t agree with, but they make a conscious decision to not change it before releasing it.
Is this ethical? I’ll grant it’s probably dumb, if I write a book that argues that black people are lazy layabouts, no matter how much I say “well, that’s not the point, and I don’t actually think that” or even “I just wanted to get in the heads or racists, I know it’s wrong, but I was trying to develop my own arguments against them and thought getting in their head was important” it’s going to come off as a hackneyed attempt to avoid backlash, not an earnest admission of flaws. Of course, one could argue that this isn’t really rational, but rather simply because artists don’t frequently create impersonal works designed to argue someone else’s point of view without including their own rebuttal.
As for ethics, I’m not sure. On one hand, I think that throwing one message under a bus in service of another is okay – like if I realize that I kind of vaguely implied that women are weak when discussion the importance of education and the bad undercurrent is so subtly woven into the narrative that it’s nigh impossible to change without just scrapping the work altogether. I don’t see anything wrong in that case with saying “yeah, it was bad, and I don’t really think that, but I thought the main message was more important than writing out some vague message most people will probably disagree with anyway.”
As for the other ones, I can’t really decide. Again, it’s probably a bad idea, but it also feels somehow irresponsible to knowingly write a book that might become a cherished work for the very groups you despise. I can’t really articulate why that is though, maybe that’s a sign I’m wrong.
Of course, this all assumes the work is written properly. In the case of the “Devil’s Advocate” style there’s a real risk of writing a book that’s nothing more than arguing the points of a strawman. In which case I think that no matter what the intent it’s irresponsible to release a book trying to get in the heads of people with a viewpoint that doesn’t even really exist. (I mean, unless the person is a genius and is using the strawman arguments to make some sort of (likely satirical) point, but that doesn’t really fit under the category we’re discussing here).