Properly treating sewage is the second way that hookworm was eradicated: the lifecycle of the parasite includes spread via feces. But shoes were the first effective measure.
A big part of why people culturally wore shoes was probably hookworm infestations. Over a lifetime you're more likely to survive if you and the people around you consistently wear shoes.