One of the ironies of LOST IN SPACE, almost a cognitive dissonance, is that some of the implausible, unserious episodes were tracked with serious, richly splendored John Williams music from the earliest (and really good) episodes.
The only first-season LiS episodes with original music were the first seven, with the rest of the season reusing the music from those. "Johnny" Williams did episodes 1, 3, 5, and 7. Episode 2 was scored by Herman Stein, Hans J. Salter, and Richard LaSalle (though I believe only Stein was billed), and Stein also did two original cues for episode 4 and a full score (with assistance by Frank Comstock) for episode 6. Additional music in those first seven episodes (including most of episode 4's score -- and the entire original pilot score) was tracked from Bernard Herrmann's scores to
The Day the Earth Stood Still, The Garden of Evil, and
Beneath the Twelve-Mile Reef (source of the unforgettable
"jet pack" music).
So Williams was only responsible for something more than half the music you're thinking of; the rest was Stein, Herrmann, LaSalle, and Salter, in approximately descending order.
And it's not really a cognitive dissonance that music by Williams was used to score comedy episodes. He was, after all, the original composer for
Gilligan's Island (scoring the unaired pilot and most of the early first season, although Comstock did the first two aired episodes), along with the sitcom
Bachelor Father and comedy movies like
Gidget Goes to Rome and
How to Steal a Million. Granted, though, most of the comedy music for LiS's first season was in the Stein episodes, I believe.
The ONLY good LIS was the short-lived comic book from the 1990's publish by Innovation Comics and written by Bill Mumy. That and the 1998 movie are all I can stand of LIS.
I'd leave out the '98 movie, which was a mess, and include the first seven episodes and some of the rest of the first season. After all, the Innovation comic was basically returning the series to its original tone and approach from those first few episodes, extrapolating what the series could've been if Jonathan Harris hadn't drawn it in a more humorous direction.