The original “Lost in Space” had some interesting morality plays disguised as scifi episodes. Season 1, Episode 11 - “Wish Upon a Star” is a good example.
Will & Smith discover a the crash site of an alien ship. Inside Will finds a machine that can materialize what ever you wish. They first ask for food (alien shish-kabob, then apples).
Soon the entire family is using it but is causes dissent. Penny tricks Will out of his turn and is scolded by John Robinson:
“I’m very disappointed in you. Your sacrificed your moral principles fir something material. You lost far more than you gained. Do you understand what I’m saying?”
Eventually Smith goes too far and wishes for a servant. A strange zombie-like creature appears (it’s muffled moans are creepy). It wants the machine back. Eventually everything the machine created withers away.