Before the middle of the 20th century religion was shrouded in mystery, dogma, and authoritarianism. Much of the vision of Christianity was fixed on religious art work between the 4th and 15th century. With this kind of baggage, it was difficult for Catholics and other fundamentalist sects to accept scientific thought like an Earth that went around a sun or basic evolution.
Science fiction writers of the 20th century like Issac Asimov, Robert Heinlein, Ray Bradbury, Kurt Vonnegut, Ron Hubbard, Richard Matheson and Gene Roddenbury became the modern prophets of the new age religions of the 20th century. This was especially true in the many chronicles of Star Trek crews.
It should be noted that "Star Trek and Religion" is taught as a course in an Indiana university. While there is some evidence that Gene Roddenberry was a humanist and a religious cynic, he was open to different concepts of advanced civilizations in the universe. Religious individuals could be controlling and cultish like "Landru" in "Return of the Archons" or distant and mentally manipulative like "The Melcosians" in "Spectre of the Gun". Some beings like in "The Q Continuum" could be practically omnipotent. A whole religious mythology could be set up from an accidental contact of an advanced civilization with a primitive one(e.g. "Who Watches The Watchers" episode.)
There are scholarly essays on religious viewpoints in Star Trek. You can find some of them here and on other websites on the internet.
However, you don't need deep religious meanings to enjoy good spaced-out adventures and that's what Star Trek and it's various incarnations have in abundance.