The similarities end there. Under religion you're told what to do. With Star Trek we find characters who have to rationalize, ponder, and consider the consequences of their decisions in regards to morality and ethics instead of being spoon fed a passage from an ancient book. Even the Prime Directive is questioned and broken as well as the pains of "life boat ethics" explored. When Star Trek says kill a child, every angle of it is explored and questioned - When god says kill a child the child gets tied to an alter.
What about Abraham and his son Isaac? To me this appears to be a story about the Abrahamic God putting an end to the practice of human sacrifice?
It is true that Star Trek is by far more self-conscious and offers a more explicit diversity of perspective. This is because, I think, the modern mind has progressed in such a way to be able to handle this better.
The Bible is actually more advanced that it appears to many...and given that literacy was a special skill back in the day, the ability to think from multiple perspectives at once, which I think was greatly aided by the technology of written language, may not have been as available and certainly not as often experienced as it is in today's post-literate world.
But if one takes a more literary perspective of the Bible one can find in at least some significant cases that there is a greater subtlety to it about the nature of the human experience.
Now Star Trek is also known for its squeaky clean and preachy moments, but also as you describe it displays a very sophisticated ability to examine its own moral grounds. I remember the Star Trek: Enterprise episode where the captain literally steals by force some technological equipment from a alien species in order to accomplish something that was needed. That was a very interesting moral line to cross for the series.
There is something in the childish attitude toward sacred teachings that seems to make people think that the literality is essential to accountability. If it isn't literally true then I don't really need to be that good. But on the other hand people bend over backwards to be so fake and pure in front of others that I think that "advantage" is more than compensated for as an equal disadvantage. It is hard sometimes for Christians to have real conversations about their personal temptations because they open themselves to easy judgment from their preachy fellow church goers.