There have been a lot of bands that do sci-fi/fantasy material. A lot of my favorites have been mentioned but here are a few that seem to have been missed:
Sci-fi-
Lost in Space (theme) - Apollo 440
The Done The Impossible Album - Various Artists (All about Firefly)
Veteran Of The Psychick Wars - Blue Oyster Cult
Starman - David Bowie
Degh - Degh (If you can find it, it's Klingon Techno... In Klingon)
Final Countdown - Europe
Down In The Park - Gary Numan
Pure Energy - Information Society
Veteran Cosmic Rocker - Moody Blues
Weird Science - Oingo Boingo
Rule The Planet (Remix) - Paul Oakenfold (From Planet of the Apes)
Not to mention all the stuff that Dr. Demento has gotten his hands on through the years (Like Star Trekkin' and The Ballad of Will Robinson perfomed by Bill Mumy) and a ton of other music that could be argued as sci-fi depending on your definition.
For Fantasy, I can think of enough off hand that would have me typing all night but I would definitely look into:
Nearly anything by Manowar
Burnt Offerings - Iced Earth
Dante's Inferno - Iced Earth
Anything from Rhapsody of Fire (They recently did some marvelous work with guest vocalist Christopher Lee... Yes *that* Christopher Lee)
O Fortuna - Apotheosis (Again, *if* you can find it. It was on the original Rave Till Dawn album before they ran into copyright issues)
The Queen II album - Queen
Anything by Running Wild (All pirate themed)
And, of course, there's a wide variety of soundtracks and classical music that fit the bill. (Wagner, Orff, Holst, etc.)
Sorry I came to the party late, but I hope you take the time to check some of these out. I will also second the recommendation of the album Time by ELO. It is entirely sci-fi themed and in my opinion one of the best constructed albums, from beginning to end, that I've ever heard.
Good Listening!!