Readers, never tell yourselves you can determine an author’s personal opinions from his writing, unless he is, like C.S. Lewis or his warped antimatter image Phillip Pullman, someone who declares his partisan loyalty from the outset.
I wrote stories with nakedly religious endings of pure hope when I was an atheist because the story logic required such an ending. Likewise, I wrote stories with a nakedly atheist ending of pure despair when I was a Christian because the story logic required such an ending.
John C. Wright, On Faith and Works in a Science Fictional World
This makes me think of our priest who once said, "I never judge a book by an author's personal life."
I've got to honor an author who is able to serve the story honestly instead of letting it become their bully pulpit while pretending to be completely neutral. A favorite author of mine who does this is Ted Chiang who is an atheist but whose stories often look at faith and humanity in extremely thought provoking and original ways which are always true to the needs the story dictates. Sometimes religion wins, sometimes it doesn't but both believers and atheists are given excellent food for thought.
If you go and read John C. Wright's original article, his example of reactions to what he wrote when an atheist versus what he wrote as a Christian, both in the same book, is both amusing and instructive.