That said, I think it's natural for authors to include perspectives from their own spiritual or religious world view, and I thought I'd reflect a little on how I've done this in my novels.
So first off: What are my beliefs? It probably comes as a surprise to very few people who know me, but I identify as Pagan. Ta-da!
I was not raised in a Christian family (though I lived in the Bible Belt for some of my youth, and being the only kid who didn't celebrate Christmas--insisting on drawing Old Man Winter instead of Santa for arts & crafts--did cause me some issues). Cognizant of how mainstream Christianity was in my culture, and being aware from an early age that I shouldn't make my protagonists simply avatars of myself, the first two main characters I invented actually were Christian. But I didn't really know what that meant. In the novel I wrote when I was fourteen, the only sign that Cristabel was Christian was that she listened to Amy Grant. (Haha.) And in the second novel I wrote, Skyler's family went to church. (There was even a scene that happened in church.) I had been inside a church like twice at that point for weddings, so I didn't really know if I was doing it right, but I guess I just wanted to prove that my characters weren't me. They also both had brothers while I had sisters.
Some of my short stories include religious themes as well. My short story "Bloom" (which I want to turn into a novel one day) features a nature-based religion with a Goddess culture. My short story "Derika and Emily" actually involves a character being upset that her best friend has left the church and has become both a Pagan and a lesbian. (The story tells both their sides.) My short story "Goodbye" includes an atheist perspective. "Grace" is set in a culture that uses elemental magic and unconventional mating practices. "Modern Goddess" is a pretty horrible little story about a religious prophet of sorts who commits blasphemy. "The Mother" is explicitly about a Wiccan woman who lives on another planet and misses her "Mother," the Earth. "On the Inside" involves more elemental magic and a Goddess-oriented culture (though it's polytheistic).
Very rarely did I write with a specific intent to comment on or advocate/criticize a religion, and if the characters did it in the context of their stories, it wasn't presented as a message to the audience about what they should accept. I think there's no reason authors should leave their spiritual or religious perspectives at the door when they write, because these elements of our lives are part of who we are and we can't expect everything we write to leave them out in the interest of not alienating anyone, but I would recommend that unless you are explicitly writing a frame story designed to introduce a philosophy or spiritual message, you should avoid actual preaching in your stories.
Anyone want to share perspectives on how they use religion in their stories?