I've realised recently that gods and religion is a big difference for me. Sci-fi, to me, doesn't do religion and certainly doesn't have gods.
While I don't think that entitities like the Christian god should interact with a SF setting, an equivalent of polytheistic divinities like the elves of Iceland or the spirits of Japanese stories might be feasible in a soft SF setting which has distinct but overlapping realities, and entities reaching or even passing through these realities.
In a setting where most matter is made up by nanomachines controlled by a collective command, artificial or downloaded intelligences may act like such divinities. In a setting allowing magic (e.g. psi-talents), those who have those talents may interact with the programming. The Force in Star Wars is something like a collective network of nano-machines or symbiotic organisms that may offer perception or even affect phsyical change in the world around them. There is no personalized god, but an impersonal one.
There are quite a few settings which equate the unknown risks of FTL space with Lovecraftesque monsters, even settings like Alan Dean Foster's Homanx, or more common in various space fantasy games.
Traveller in its general setting has no mention of overarching religion IIRC - although individual planets can have their own local beliefs and potential religion-related governments. I guess I assumed that the many parallel version implied that there were all equally wrong.
They aren't shown as having a tangible physical effect, although they are acknowledged as powerful memes or philosophies that control their adherents. Which isn't that dissimilar from former military believing in clear hierarchies and execution of received commands to the limits of the doctrine.
The Mindjammer setting with its technologically created mind collective uses this meme effect as major plot point. The feedback from adherents to such memes must be vetted to preserve the mind collective, and at least in the sample novel, that is the job of the player characters.
Some of the exiled and isolated memes include high virtues of our society...
I've been running a few Numenera sessions and a player asked what the people believe in. I realised that I had ignored the question as, to me, Numenera-as-Sci-fi made that irrelevant. But - actually I have to agree monkey-brains will probably invent tripe to believe in whatever the time or place.
This is also why Starfinder is definitely Science Fantasy rather than Science Fiction: not the goblins or tech or the magic/psionics - but the gods.
If the gods were powerful entities with super-technology or capable of altering the reality through instinctive means feeding off something provided by their adherents, would you still say that this is fantasy, or can this retain the SF label?
I don't claim to understand polytheism, but some divinities there may be as mortal and flawed as the people looking up to them for guidance. A meme which can make its adherents into suicidal or at least fatalistic fighters doesn't have to be a religion - think various warriors' codes of honor, or ordinary soldiers commanded to make a last stand to cover some other military effort - basically is indistinguishable from a religion, and if the meme has a group controlling its distribution, you might call them its priesthood, or you might call them its pantheon.
If you use other species than humans or near-humans, other such concepts may come into play. As soon as there is the possibility of bleeding the core of one's individuality into a hive sapience, or to establish a back-up or blueprint of oneself in such an institution, the regard for the individual existence may change significantly. You may call this transhumanism, or you may call this the wood-elves one-ness with the song of the forest. The Navee of Pandora sit pretty much in this transition from fantasy or religion to modestly hard SF. The Edenist culture in Hamilton's Night's Dawn trilogy is rather close to that, too, and allows expeditions into the hive mind encountering mind copies of lost family described pretty much the same way as Cabell's Jürgen.
A lot of tropes can be deconstructed and re-clad to serve in a different kind of setting. The minimum law frontier trope is typically associated with the Wild West, but applies just the same to Viking Age adventuring and settling. This is a typical trope in various forms of Space Opera without the need to include colts or stetsons.
David Weber's Honorverse is basically taking the tropes of Napoleonic era naval warfare into space, and then flanges on various other tropes, leaving the stories of C.S. Forester behind for themes like religious fanaticism, oppressive creeds, slavery and toxic transhumanism.
The world-changing stuff in SF rarely has absolute morality, but then quite a lot of the more nuanced fantasy doesn't have clear-cut good or evil. While we find forces of seemingly mindless or thoughtless destruction objectionable, we can easily put ourselves into the mindset of a farmer applying pesticides to promote growth only of those crops he finds desirable. When your perspective is on the receiving side, such a procedure is pure evil. When your perspective is on the side of the farmer desperately trying to avoid a famine, there is nothing evil about this.
Knowing the motivation of the farmer doesn't make his actions any less harmful to you if you are playing the vermin. It might not be absolute evil any more, but still your survival and that of your community depends on stopping the farmer.
As much as I prefer nuanced fantasy settings without moral absolutes, I prefer SF settings that allow exploration of various different ideas. I would love to play in Bujold's Vorkosigan universe, and I wouldn't mind the militarism of Weber's Honorverse of Elizabeth Moon's Serrano setting much for some adventuring in those sandboxes.
I still have to play in the Mindjammer setting. It isn't a setting I would run, but I'd like to experience it a bit.