Star Trek never really took religion seriously. In fact it went almost unmentioned, except for the one episode in TOS set in the Rome like planet. I always thought that Roddenberry believed it was something childish that we’d outgrow. Babylon 5 and Battlestar Galactica on the other hand do take it very seriously, and are better fiction.
“Star Trek,” and some earlier pieces, are a sub-trend, as it were, in that way. (By always, I meant “throughout the existence of these genres,” not “every individual piece.”)
The fantasy of a world without religion, money, poverty, ignorance, and so on goes way back ... although it appears that more people believe such a scenario is both possible and desireable than used to.
I think there was another Star Trek episode that had an unmistakable Christian reference (although I might be confusing it with the same one you already mentioned - so correct me if I'm wrong.)
There was an episode in which the Enterprise encountered a seemingly primitive group of people who appeared to be Sun worshipers. Always referring to the Sun this and the Sun that, but near the end of the show it was discovered that they were not worshiping the Sun. It was the Son - Jesus Christ.
Was that a different episode or the same one you mentioned?
Star Trek was first of its kind but in retrospect the writing really wasn’t that great. Compared to something like BSG or even Firefly, it is like comparing the Post Office to Fed Ex on quality.
Despite that B5 was created by an Atheist.