Lost in Space "got campy" in its first season. It wasn't coldly serious for the whole year, and you can see the switch pretty clearly from fairly solid, straight SF adventure to wacky fantasy. The real transition from serious to comedy was The Space Croppers, when the Robinson's are visited by aliens dressed as hillbillies in a space ship that looked like a log cabin. From that episode forward, things got dicey. Suddenly Smith's comedy antics really took center stage. The main difference in season 2 was that the series became Children's Theater, with wacky monsters and colorful eccentric aliens.
The 3rd season did indeed try to go back to something more serious, but it was too late for the Smith character. He was so childlike at this point, you couldn't put him into anything remotely serious anymore.
What kept shows like Voyage and Time Tunnel from falling into the same trap was that, while the situations got wackier, the character remained the same and in the same positions of impotence. Nobody got shoved into the background or turned into comedy relief. So if the Seaview ran into puke sucking monsters three weeks in a row, they could switch back to serious espionage without it being an ill fit.