I'd count Star Trek as science fiction rather than science fantasy because Trek's tech and universe is presented in a more or less "scientific" fashion. (Yes, sometimes they get the science wrong. Badly wrong.) Sure, some elements of the setting are things like FTL travel which are generally considered impossible under our current understanding of scientific laws, but it's never presented as anything magical. It's everyday technology that people more or less understand, and guys like Scotty and Geordi aren't wizards (miracle worker claims nonwithstanding). Even when Q shows up, he's not seen as a god, but just a highly evolved lifeform, no matter what he claims (though possibly he was just trolling Picard again).
Now compare that to Star Wars, where we basically have wizards that use glowing laser swords made of pure awesome. That's fantasy. Star Wars rarely tries to be even remotely scientific. Though that might be a hidden strength. Unlike hard sci-fi, it doesn't have to worry about being completely disproven by some scientific discovery a few years down the road.