Back at the birth of RPGs (generally acknowledged to be around 1974, the time of the first publication of the D&D rules), science fiction and fantasy were really not very distinct. I mean, Anne McCaffrey insisted that her Dragonriders of Pern series was science fiction, not fantasy. You had the covers of Heavy Metal magazine, which often consisted of a scantily-armored chick with a sword and a blaster. And even the movie Star Wars, possibly the greatest impact science fiction had on our culture, was really as much fantasy as science fiction.
And back in the 70's and early 80's, we seemed cool with that. Well, okay, I was only a kid, and wouldn't have understood the difference much otherwise. But it seemed that Dungeons & Dragons games often had a mix of powered armor, vibro-blades, and laser rifles muddying the waters of homebrewed Middle Earths. On the computer front, the early Ultima games mixed hover cars, space ships, evil computers, and time travel pretty freely.
Somewhere in the mid 80's (subjective time), the dividing line came down. Fantasy, as a genre, began standing on its own on the shelves of the bookstores, instead of being lumped into the anemic "science fiction" shelves. People started drawing a hard line between what constituted fantasy and what was required of science fiction. The term "speculative fiction" had been coined to include both genres, and began coming into vogue sometime after that to prevent the terms for the specific genres from getting misused with broader meanings.