In 1987, the arrival of Star Trek: The Next Generation brings a reevaluation of Star Trek, and in many ways moves the viewer from a thoroughly modernist narrative in the Kirk era to a much more post modern perspective with Picard. Overtime, as the series matures, we see an appreciation for all things mystical from dreams to visions, from the experience of the beast within to the experience of the transcendence of becoming a god like being. Although there is from time to time a harkening back to skepticism, for example the Klingon warrior/prophet Kahless who magically appears is discovered to be a clone, there is on the whole an appreciation of religious experience, if not for religious systems.
This transformation reaches its fullest expression in Star Trek: Deep Space Nine which is interesting in that it depicts a series of religions that actually work. Bajoran spirituality, Klingon religion and even the belief of Humans are shown to have deep meaning, and are in fact rooted in reality. Although Major Kira comes to understand she is worshipping what the Starfleet refers to "wormhole aliens" this does not reduce the importance or reality of her faith. In fact, as revealed late in the series, the entire arc of Deep Space Nine can be seen as the impact of a prophetic calling for Ben Sisko. In this motif, Starfleet is cast in the role of skeptic, while the various alien communities are by contrast deeply immersed in faith. When they pray, they receive comfort, and when they worship they receive meaning.
Star Trek: Voyager in many ways straddles the modern and post modern, as the follow up to the Next Generation. Native spirtuality, at first debunked in Classic Trek, and then revisited late in the Next Generation is now revealed to have a deep reality and important function for Chakotay, the first officer. When he engages in his spiritual practice, is a real experience depicted on screen. For Belanna Torres, the half Klingon engineer, her Klingon religious practice is real, and we actually follow her on a journey to the Klingon equivalent of Hell. At the same time, Captain Janeway and Seven of Nine perform the roles of resident skeptics, debunking various Delta quadrant belief systems along the way.
Star Trek: Enterprise has some addition points to add, particularly with regard to Vulcan mysticism. Captain Archer in fact gets to experience Vulcan spirituality first hand as he channels the spirit of Surak, the Vulcan patriarch and a sort of Christ or Ghandi figure, late in the series.
Looking back over the entirety of Star Trek, one sees a evolution in religious understanding over time. Many have stated that the original series contained humanistic elements that had a strictly seccular overtone, but although that is definitely present from time to time, the fact that functioning religious communities are on occasion depicted, and their faith experience, even when rejected by the crew of the Enterprise, is often valued mitigates against this tendency. When Kirk contemplates the destruction of Vaal, both Spock in a scientific argument, and Bones asking whose right is it to interfere, defend the existing system. In his counter argument, Kirk acknowledges that he is letting the snake into the Garden of Eden, but that this may be for the best. Though perhaps not the intent of the storyline, it could be argued that Kirk citing a scriptural reference in the debate could also be seen as a validation of the role of faith.
In fact, Star Trek has a nuanced view of religion and society. The overarching perspective of the series, as expressed through the hundreds of creative contributors over time, may be skeptical, but this skepticism does not negate the potential reality of spiritual experience, the value of faith, and the role of religion in the lives of people, even in a organized fashion.