I'm only half joking when I say that the first time I heard about religion was when Obi Wan Kenobi explained The Force to Luke in Star Wars. I saw Star Wars when I was about five, and it was essentially my first spiritual instruction. Before I heard about a personal God, I heard about an "energy field that surrounds us, penetrates us and binds the universe together." It was the start of a long association of religion with fantasy and science fiction.
Some may snicker at this idea, saying that it shows the futility of believing in religious narratives. However, I think such narratives, whether literally true or not, often guide our spiritual selves.
It's surprising to see how little George Lucas reveals about The Force in the first movie. The Force is described in terms of energy and a presence that guides our actions; other than some empathic moments and a bit of telekinesis, there's very little indication that the Jedis are particularly adept with The Force. The idea that Luke is a Chosen One figure is not stressed in the first movie.
If anything, The Force resembles a very loosely defined Taoism, in the sense that The Force simply exists and we need to only follow it to tap into it. However, it's probably more correct to say (instead of "may The Force be with you") "May you with The Force!" It wasn't until the later movies and (especially) the prequels that The Force began to follow a more traditional mythology, with Lucas creating a classic Hero's Journey narrative. This narrative is powerful, but I'm not sure it's the spiritual message I get from Star Wars. The message I do get is that even the lowliest creatures - represented here by the droids and Ewoks - have worth and can change the universe.
The other big science fiction franchise, Star Trek, had a much different take on religion. Gene Roddenberry, a former Baptist turned secular humanist, had faith not in God but in the perfectibility of humanity. When I saw the first Star Trek movie as a kid, the larger themes of humanity facing its own creations flew over my head; I simply got the idea of awe at seeing a superior alien presence - of course at the time I had no idea how much the movie owed to 2001: A Space Odyssey. In general Trek is good at showing how technology might - emphasis on "might" - solve some of our problems, but in dome ways the show has never handled death well. The people of Trek don't seem to fear death by simply denying it, and the few deaths of major characters tend to be less than permanent.
What I got from Star Trek and later 2001 was the idea that an answer might be out there, that some form of intelligence or order presided over the world, and the fact that this was presented in fiction didn't matter to me. This is why I loved Douglas Adams. Adams was an atheist, and in many ways he was openly mocking the idea of "life, the universe and everything" having a meaning. But Adams taught spiritual lessons even when he didn't mean to. A little joke buried in one of the novels - about how if we ever figured out the true nature of the universe the universe would collapse and be replaced by something completely incomprehensible (and that this might have already happened) - is like a zen koan. As well, in Restaurant At The End Of The Universe Adams revealed that the universe was being guided by the decisions of a man living in a shack who had no actual interest in the outside world. Whether he intended to or not, Adams had described a Taoist view of the ideal government.
Blade Runner is another movie that influenced my spirituality, and my understanding of it has grown over the years. When I first saw it as a kid (way too young to get the philosophical ideas) I saw it as a simple good vs. evil story. When I saw it again a decade later, it struck me as an almost nihilist story in which no one is saved. Now I see it as an existentialist story in which Roy Batty is the actual hero, who gets to actually ask his maker why he was created just to die. In no small part due to Rutger Hauer's performance (and his famous improvised speech) Batty seems more alive than Deckard. (And no, I don't think Deckard is a replicant).
Blade Runner led me to Philip K Dick; ironically, the movie does not do his philosophy justice. Dick had an interesting view of reality: it shifted from moment to moment, and his later works dealt with his experience of what he believed was a divine intelligence in February of 1974. Dick's books touch on Gnosticism and Taoism in fascinatind led me to Robert Anton Wilson. RAW's writing is unique. In best-known work, The Illuminatus! Trilogy, the parameters of reality change from chapter to chapter; you actually feel the book altering your consciousness. Until his death RAW was an extreme agnostic, refusing to make reality claims about not just God but science and pretty much everything else.
When I think about what I get out of science fiction, I think back to Star Trek and an unlikely source for spirituality. One of the ironies of Trek is that the alien civilization most associated with logic is also one of the most spiritual. The famed Vulcan control of emotions belies a deep inner life, with a philosophy that has echoes of stoicism, Zen Buddhism and Leonard Nimoy's own Orthodox Jewish background. The most famous Vulcan phrase, "live long and prosper," is a practical blessing for a logical people, offering no more than peace in this life. But it's a good idea to live by.