The joke is a pun I think? The phrase 'thirst for knowledge' is often said to mean 'a desire to learn'.  Thirst also means being in need of water, and this person is studying water purification.
He studied water purification and had a great thirst for knowledge .