The reason Jeannie's entire family are magical when she frequently mentions growing up as a human is because the curse put on her when she refused to marry the blue djinn extended to her entire family. Jeannie 2 was once a normal human girl who just wanted to dance and have a good time. Jeannie refused to marry and in return, gets a two thousand year nap and a handsome, loving (if not uptight) master who instantly frees her and doesn't demand anything from her. Jeannie's sister got two thousand years of involuntary servitude under a series of cruel, stupid and neglectful masters. She takes full advantage of having magical powers but that doesn't mean she asked for them.
- Considering Evil Jeannie had hundreds of past lovers in one episode, it is also possible that she was, well, naughty and as turned into a genie as punishment.
Each is a television show in the other show's universe.
In Star Trek Starfleet is a military offshoot of Earth's space exploration programs, in real life NASA is non-military but in IDoJ NASA is explicitly a military organisation. Genies and other reality warpers also fit right in with the Trek-verse. Even the show's odd technology fits, NASA has a working flying saucer and conducts a lot more launches in IDoJ than it does in real life, which fits with Gary Seven's mission to stop an orbital weapons platform in the Backdoor Pilot Trek episode "Assignment: Earth".
In Lost in Space it's made clear that magic and technology exist side-by-side on many planets. Many beings live for hundreds of years. Genies and other beings such as ghosts, dragons and viking deities meet the Space Family Robinson. NASA is explicitly a military organization. Air Force Colonel and Psychiatrist Dr. Bellows had a major role in base operations and high security clearance. It's evident this was standard in the space program, as (less justifiably) Space Force Colonel and Psychiatrist Dr. Smith has the same major role and high security clearance.