Some folks have been questioning the status of religion in Star Trek.
This is a complex subject.
The fact is, religion is not given a consistent treatment in Star Trek. Sometimes it’s treated positively, sometimes neutrally, sometimes negatively. One can’t draw simplistic conclusions about how Star Trek regards religion. Star Trek has produced over 700 hours of material, and in reality how religion is treated has do to with who was writing those individual hours.
This is true from The Original Series onward.
In The Original Series we had some episodes, that spoke respectfully of religion. For example, there was "Bread and Circuses," in which the crew visited a parallel planet where the Roman Empire never fell and there were televised gladitorial matches and such. During the episode they learned of an underground group of sun worshippers and were perplexed by this as ancient Rome <false claim>didnt’ have a lot of sun worshippers</false claim>. At the end of the episode, Uhura informs them that she’s been listening to the planet’s broadcasts and that the sun worshippers don’t worship the sun in the sky, they worship the Son of God, and the show closes with a direct allusion to Christianity and the possibility God is incarnating on other planets.
(It also, apparently, indicates a problem where the Universal Translator gets confused with homophones. Where’s Hoshi when you need her?)
OTOH, there were episodes of TOS that were very disrespectful of religion. The worst was "Return of the Archons" where a parody of the Christian religion is at the center of the episode. In this one, they visit a planet controlled by a being known as Landru, who is in total mental domination of the inhabitants, whose are "absorbed" by lawgivers (priests) into Landru’s "Body" and become smiling, 19th century zombies totally given over to "the will of Landru" in a stultified society that never makes any progress and that represses the violent and sexual urges of the people to the point that they have to have a bacchanalia evey year to blow off steam.
"Landru" is lader found out to be a 6,000 supercomputer programmed by a(n ostensibly) altruistic guy who, in Kirk’s words, nevertheless could not give the computer "his wisdom" and so the society he created to save his planet from the ravages of war ended up being not such a paradise after all.
This nice-talk about the historical Landru is a load of fetid dingo’s kidneys meant to deflect charges that the episode is anti-Christian, because the truth is that Landru is a cipher for Jesus, the lawgivers are ciphers for priests, and the "Body" is a cipher for the Church, which Roddenberry (who wrote this episode) mocks by presenting us with a repressed, totalitarian, society of smiling fuddy-duddy zombies.
This was not the only time Roddenberry let his anti-Christian streak show. Multiple episodes (and the first Star Trek movie) are all based on the idea of going into space and symbolically finding God and finding out that he’s a fraud, or an alien, or a child, or a computer, or insane, or some combination of these. The two twin themes Roddenberry felt drawn to were "God is unworthy of worship" (for one reason or another) and "There ain’t no paradise except the Federation" (all other paradaisical societies having some horrible hidden flaw).
Paramount didn’t let Roddenberry go whole hog on these themes, so he had to mask them (with things like Landru), but they’re there. In other episodes (even ones Roddenberry co-wrote, like "Bread and Circuses") religion is treated more respectfully.
When it was time to make Star Trek: The Motion Picture, Roddenberry’s original treatment included the idea that the V’Ger machine was really behind Jesus Christ (another God as childish supercomputer theme)–a fact that would have been made explicit to the audience by the V’Ger (briefly) projecting an image of itself as Jesus Christ.
Paramount totally nixed that idea.
Roddenberry was thus suitably enraged when Bill Shatner got to incorporate an explicitly God-oriented (and braindead) plot in Star Trek V: The Search for God (or whatever it was called).
Things got worse when Roddenberry got to do Next Gen, in which he had far fewer shackles on his secular humanism compared to what he was allowed to put on television in the 1960s. Not only were the episodes in which Picard gleefully proclaimed that humans are merely electro-chemical machines, there was also the awful "Who Watches The Watchers" episode in which the ship finds a planet of primitive proto-Vulcans and accidentally starts a religion among them, leading to a prime-directive violation in order to stamp it out. Secular humanism is in full force in this episode, and religion is treated very disrespectfully.
Roddenberry’s secular humanism was one of several dumb things he imposed on the series. The idea that the Federation was a paradise and didn’t have money were others.
But this wasn’t the end of the story.
Roddenberry died, and afterward the franchise passed into other hands. These folks, whatever their flaws, tried to undo some of the conceptual damage that Roddenberry had done and loosened the ideological straightjacket into which he had put certain elements of the show.
The franchise then got more friendly toward religion. In fact, the next two series–Deep Space 9 and Voyager–both contain episodes that are extensively devoted to and positive about religious themes.
Deep Space 9 has three major religions in focus: Bajoran religion, Dominion religion, and Klingon religion. It never proclaims any of them true (and in fact, it’s quite clear that the Dominion religion is false), but it offers the show extensive changes to discuss things like the value of faith, the role of evidence for faith, what the prerogatives of God are, how one may need to sacrifice personal power and prestige in order to embrace true spirituality, how seeminly unconnected events can be part of a divine plan, how the loss of faith and the betrayal of faith are bad things.
There’s one moment in a DS9 episode in which the Kai (the main Bajoran religious leader) discovers that someone close to her has embraced the Bajoran equivalent of Satanism and, stunned, her instant reaction si to slap him very hard and cry "Heretic!"–and the thing is, you agree with her! He is a heretic! He needs to be slapped! The Kai (for once) did the right thing.
Sure, the moment is masked with the trappings of an alien religion, but how often do you find a moment on television that affectively conveys to the audience the horror of what heresy is.
This is something that simply could not be achieved without the sci-fi setting. If you had the pope slapping a Satanist here on Earth and yelling "Heretic!" at him, the audience would be pulled into all kinds of analysis and introspection about Christian history and "oppression" and violence and love and compassion and such and the emotional horror of heresy would be muddied.
But in the sci-fi setting, even secular members of the audience are on the Kai’s side, cheering her on, making the moment a protoevangelium for them.
Unfortunately, the Kai’s resolution is fleeting and she subsequently succumbs to the same heresy herself, only to find redemption (another religious theme) later on.
Even when we know the religion we’re being shown is false the series still manages to pull out interesting insights. For example, there is one episode in which the Dominion character Weyoun, who has been genetically programmed to worship the Founders of the Dominion, is discussing the matter with someone who points out that the Founders have controlled the development of his species so that he worships them.
Weyoun replies: "Of course! That’s what gods do!"
In another episode, Weyoun is chuckling to himself about how silly and superstitious the Bajorans’ worship of the Prophets as gods is and another character points out that Weyoun himself worships the Founders as gods.
Weyoun instantly becomes very serious and says: "That’s different."
"The Founders are gods."
We, the viewers, know that Weyoun’s religion is false, but they still admire Weyoun for sticking by his beliefs. He may be immoral in other ways, but he’s going to stick by the priciples of his faith even if others don’t, and you respect him for that.
There is even a very touching moment when Weyoun dies (one of the times he dies) in which he knows he may have sinned and is extremely anxious to receive his god’s "blessing" (read: "absolution") before he passes into the next world. Weyoun is genuinely fearful of what may happen to him if he isn’t absolved before he dies, and it is a moving moment.
Star Trek Voyager also has significant exploration of religious themes. In this show we finally get a human character who is overtly religious (Chakotay, who follows a religion based on the beliefs of Native Americans), and there are episodes that directly imply (in a variety of different contexts) that matter is not everything and that there is a spiritual dimension to the world that we need to pay attention to and that we may need to rely upon for help.
There is even an episode ("Barge of the Dead") that warns that we need to take the possibility of going to hell seriously. In this episode, the half-Klingon B’Elanna Torres experiences has a near death experience in which she is made to understand that, if she says on her current path, she will go to hell (albeit a Klingon-themed hell).
The current series–Star Trek Enterprise–has also touched on religion in non-dismissive ways.
In a first season episode the alien Dr. Phlox comments positively about his study of Earth religions, mentioning in particular his visit to India to learn about Hinduism and his attending Mass in St. Peter’s Basilica in Rome.
This season we got to see the Vulcan equivalent of the Reformation take place (though the differences are enough that there is no Catholic-bashing message here; it’s just a Reformation-like event on another planet), and afterwards the Vulcan first officer T’Pol is shown spending a lot of time reading a book that is explicitly referred to on screen as a "Vulcan ‘Bible.’"
Who’da thought we’d see a character doing the sci-fi equivalent of Bible study on Star Trek?
So, while Star Trek has many flaws, and while Gene Roddenberry was an anti-Christian secular humanist, it is not accurate to portray the series as if it was uniformly hostile to religion. While there are anti-religious episodes, there are an increasing number of positive and even interesting treatments of religion on the show.