I'd also add that it's relatively easy to come up with a 'yes, but what do we do?' for fantasy, and that helped it right out of the gate. With a Star Wars game, you can recreate the original movies or have another attempt to defeat the Empire's other important installations three planets over or whatnot, but that's quite a bit of heavy lifting on the planning. Star Trek you could run into a new planet of hats each week, but again planning. Traveller made it fairly simple in the what being 'pay the mortgage on your ship,' and I think that's why it beat out plenty of other early SF RPGs (including an early Star Trek one) as one of the preeminent sci fi RPGs. While plenty of other RPGs have flourished -- including things like White Wolf Storyteller, which didn't tend to have dungeons to loot (/focus on money/treasure in general) or epic battles of good&evil, a lot of them have struggled with the issue of 'what does the average gaming adventure look like?' and often there's lots of inter-table variation and it requiring inventive GMs to keep the thing going.Let's start with the basic question, before getting into the "good" and the "bad" of fantasy. Why? Why fantasy? The short and simple answer is similar to the reason we climb mountains- "Because it's there." The slightly longer reason is because of the historical antecedents- D&D was the first RPG. The early RPGs that followed were often either reactions to D&D (Bunnies & Burrows), or were, for the most part, house rules and expansions of the original D&D rules (Chivalry & Sorcery). The gestalt of the 70s, from Tolkien to Led Zeppelin to Baker-era Doctor Who to Star Wars (which was "A long time ago ..." and featured swords and wizar.... um, Jedi) was conducive to fantasy. There was definitely a first-mover advantage. But while that is all true, it isn't the entirety of the truth.
I would say (and I have said) that another reasons that fantasy predominates in the RPG world is because fantasy, moreso than any other genre, particularly lends itself to both the "campaign" and to the reward play loop (zero-to-hero) that so many people enjoy. In addition, while other genres have examples of group play (Science Fiction has Star Trek and the bridge crew, while Super Heroes has, inter alia, the Avengers or Guardians of the Galaxy), few genres have such a well-entrenched (and copied) example like the Fellowship.