Just playing to the audience. No matter his thoughts on religion, the audience was still predominately religious in the 1960's.
It seems like it, but they asserted that religion was not going to be a part of Star Trek. Here is a quote from Memory-Alpha: Brannon Braga said that "In Gene Roddenberry's imagining of the future [...] religion is completely gone. Not a single human being on Earth believes in any of the nonsense that has plagued our civilization for thousands of years. This was an important part of Roddenberry's mythology. He, himself, was a secular humanist and made it well-known to writers of Star Trek and Star Trek: The Next Generation that religion and superstition and mystical thinking were not to be part of his universe. On Roddenberry's future Earth, everyone is an atheist. And that world is the better for it.”