Does using unexplained spiritual elements (soul, "spiritual"/non-physical beings, afterlife, God, etc.) in a story with a futuristic setting make it science fantasy rather than science fiction?
Is Star Wars fantasy or science fiction? I say fantasy, but they sell it as SF.
So there are stories which meander along the borders. But to categorize your story you should not only ask what it is about. For example it's also important how the story ends.
We are tagging genres to make it easier for the readers to pick what they want. If you sell a romance and it has no happy ending you can really disappoint a whole bunch of readers. A tragedy they wouldn't have picked up.
High Fantasy is often about the eternal fight of Good and Evil. If Evil wins, readers could be disappointed. They don't expect (and probably do not want to read) such an ending when picking up this genre.
When you are in doubt about your genre, ask your test readers. Often their distant point of view can clarify this issue more easily.
Or look at the books you read yourself and ask to which of them your book is most comparable to. Then use the genre of that book.
There are a few ways to answer this. Which answer you use depends on what you want to achieve - something lacking in the original question. Does the work already exist and you're just trying to categorize it? Or are you in the planning stages?
For this answer, I'm assuming that there are deities or other spiritual elements explicitly in your story.
If there are deities:
Deities of any sort are fantasy, and we should all grow up and acknowledge this. This is the prototypical hardline-atheist answer. Your book will be looked at as such.
Deities may seem unlikely, but what if "god" is really just a powerful energy being? Arthur C. Clarke did this, as did Star Trek. It's a way to have gods in your fiction, still have it be science fiction (maybe), and avoid disrespecting religion.
"Pagan" gods are, of course, fantasy. The god I worship is real, so that makes this sci-fi. That would make your book religious fiction. I'm not aware if religious science-fiction exists or not, so you'd either be joining an existing genre or creating a new one.
If there are no deities, but there are spirits or ghosts, that would probably make your book a fantasy, or possibly what's now called a "paranormal" book.
Sometimes, it all comes down to a very precise answer to a very simple question: Are you dealing with magic or advanced abilities that transcend the current human understanding of the universe?
Some people will say that there's no difference between those two things. For such people, it's all fantasy, end of story. However, those people make up a fairly small percentage of the science fiction community.
There has been a long history, in science fiction, of elements that are beyond our current understanding of the laws of the universe. Some are relatively minor (the movie Dreamscape) while some have been quite dramatic (the Q in Star Trek, or the Vorlons in Babylon 5).
On the other hand, there have been stories with magical and religious elements that still had the look and feel of science fiction (Star Wars, and the Warlock of Gramarye books by Christopher Stashef). Some people consider them fantasy, some don't. Does it really matter?
In the end, I think the most important thing is to focus on writing a good story. Let people argue about labeling it once it's been printed.