Edit: In the High middle ages
More can be written about this, but the myth of unclean drinking water has been addressed in discussions here before. I think the best discussions are the replies of /u/Qweniden in "What factors made beer so important to the establishment of civilisation? What made it a more practical drink than plane water?" . It's pointed to from the FAQ area "Health / Hygiene And Healthy Lifestyles" .
This is not to discourage discussion. Further questions, data, and debate are welcome.