Lost In Space started out with a serious tone. The black and white media enhanced that even more. But later on, Irwin Allen decided he wanted to have a more family friendly show that would appeal to kids rather than scare them. Lost In Space could have been a more serious show like Star Trek, but definitely went to the silly comedic corner instead. And there's nothing wrong with that, because it's all about defining the kind of show you're looking to produce for your target audience.
There's really NO POINT in comparing these two TV shows. They are very different in nature. Star Trek is far superior in a number of general respects, most of all in the abilities of the actors and the production values. But to say one is better than the other is like saying an apple is better than an orange because it's easier to eat.