One contemporary author who often writes fantasy and science fiction on social issues is Steven Brust, and he has a rule that when he puts his personal viewpoints into the mouth of a character, he uses a character whom the reader would have a narrative reason to dislike, which forces him to be honest with himself, and more impartial with the reader.
If you tell someone there position on some topic is wrong, they will argue with you. If you tell someone a story where the character takes the same position they have and then through experience and personal growth comes to understand how it is wrong. They can come away realizing that they might have it wrong. Great trick when it works.