I think there are a number of factors: suspension of disbelief, the numbers game, the elevator pitch, wish fulfilment
I think it's easier to suspend disbelief with fantasy games. My group is made up of people with graduate and post-graduate education levels, mostly in maths, science or computing. With Sci-Fi it's easy to poke holes or say 'it wouldn't work like that'. With fantasy, suspension of disbelief is the first requirement otherwise you couldn't have things like dragons that can fly. Sci-fi invites more attempts at rationalisation, and this can damage the fun of playing.
In terms of the numbers game, I think it is a case of self-reinforcement. What ever RPG you played first will shape your view of RPGs in general. Since the majority of people play fantasy, the majority of new comers get introduced to this type of game. The majority of game designers want a game similar to what they play but with enough difference to cover perceived problems with the game they currently play (and so more fantasy games get made...). Etc etc...
I think one of the reasons D&D stayed strong after other games like Traveller came along was it's 'elevator pitch'. The premis of the game is easily understood
and attractive to game. Explore, find weird creature, overcome them and get rich. Simple to understand, and sounds fun. I think Traveller had a less clear and compelling premis for people to engage with. When I think of Traveller I think of space trading. I may be wrong (I probably am, I know there is a strong military aspect, too) but that is what comes to mind and it doesn't grab me.
I think wish fulfilment is a strong aspect of the attraction of RPGs, both to younger players who haven't found their place yet in the world and to older gamers who want to escape that place.

I think fantasy more clearly addresses this need. It's more about the personal abilities and capabilities of your character than what kit you have (unless you are playing a magic-item-heavy game, naturally). This is less true in sci-fi or other genres, where mechanical advancement may primarily come through getting a better gun or faster ship. It's less intimate in the way it addresses empowerment.
I think all of the above are factors, but they are all marginal. Maybe people are only a little more likely to prefer fantasy for any of the reasons above, but given that it's still relatively unlikely for people to get into RPGs anyway those small nudges have an impact.
And there are, of course, many people who aren't swayed by these things. They're the people who don't primarily play fantasy
