What is behind the pedophilia references when people talk about "lost in space"

Was one of the actors a pedophile in real life or did he just act awkward on the show.

The reference is to the character of Dr. Smith. In the earliest few episodes the show was a space adventure and Smith was the villain, a sabateur who found himself an unwitting stowaway on the space mission he was supposed to destroy. But the show gradually changed focus; it became a campy farce, and Dr. Smith evolved into a cowardly mincing dandy.

A large number of episodes revolved around the teaming of Smith, the Robot (serving as a sort of sarcastic straight man), and Will Robinson, the boy genius who was smarter, more mature and more responsible than the “adult” Smith, who constantly had to get his chestnuts pulled out the fire.

Pedophilia was never stated or even hinted, but Smith’s fondness for the company of young William has become a sort of running gag about the show.

Danger, Bart Simpson!