The word "protect" is a verb. To fit the sentence grammatically and lexically, it needs to be transformed into a noun. The noun form of "protect" is "protection".
Therefore, the completed sentence is: John first became interested in the protection of the environment when he was a student.