In the very first LIS episode, Dr Smith appears to be a medical doctor. He also occasionally acts as a doctor throughout the show. But he also has programming skills (as seen in the first episode onwards) and has reasonable mathematical skills (as demonstrated when he was mistaken for Zeno and said: "Can Zeno tell you the difference between Differential and Integral Calculus?" So what does Dr Smith actually have his PhD in?
Per the excellent "Lost in Space" wiki, in episode 3 ("The Kidnapped of Space") it specifically states that
Dr. Zachary Smith is a Doctor of Intergalactic Environmental Psychology
In the TV show, he also claims to be a medical doctor, a psychologist and a psychiatrist. Whether this is simply bluster or whether these are aspects of his PhD is not made clear.
In the 1998 film script, his role seems to be more focused on medicine;
"Doctor Smith is [the] base physician"