In my 'France in the Middle Ages' class, my professor mentioned that, because getting clean water in the Middle Ages was often challenging, people most often just dank (weak) beer. Is this in fact true?
Ond hwæt drincst ∂u? Ealu, gif ic hæbbe, o∂∂e wæter gif ic næbbe ealu (And what do you drink? Ale, if I have it, water if I have no ale)
There's no doubt that medieval people generally preferred ale (or beer where applicable) if they could afford it, but mainly for reasons of taste, not really because of concerns about cleanliness. If anything a common fear was of brewers cheating customers with cheaper but unhealthy substitute ingredients, which led to brewing becoming an increasingly regulated profession over time. It's a bit harder to tell how it was in antiquity because of a lack of records but if they could afford it, they probably preferred alcohol over water.
Digging wells that provide clean drinkable water is something people have been doing across the world for thousands of years, often with tools more primitive than they had in the Middle Ages. Pre-modern societies are also overwhelmingly rural and there would have been relatively few places where human activities polluted rivers, lakes and ground water to the degree it becomes a health hazard. Main problem spots would be large cities or sites with industrial activities. For example as medieval London's population grew the local water situation worsened and a decision was taken to pipe in clean water from the river Tyburn "for the poor to drink, and the rich to dress their meat".
The quote also shows that wealth and status played a part in alcohol consumption and what people thought of water. Note that while the wealthy were relatively few, surviving inventories show they usually paid servants in both money and goods, including copious quantities of ale. Same went for sailors and soldiers. Poverty was therefore not necessarily a barrier to major daily consumption. And even the poorest will strive to brighten their dreary days with a treat, even if they can't afford much.
That said, before modern medicine people could have rather strange ideas of what was and wasn't healthy. Thus you can find texts both for and against water, arguing from the notion of humours (rather than cleanliness). In other words they were arguing about the essence of water, if it possessed a quality that was intrinsically healthy or unhealthy. Considering that many people will rationalize why it's a good thing to consume what you like, it's perhaps not too surprising many learned people thought alcohol was better. And to be fair, on a cold winter's day it could help keep the old bones warm.
Finally, a major reason for brewing alcoholic beverages is that it's a way to store calories for a decent length of time, an important consideration in an age without freezers. Nobody can live on liquids alone but they can provide an important calorie boost in an age when hard manual labor was the norm. Ale was a fairly weak brew with a shelf life counted in weeks. Beer is made with the help of hops, a 12th century German innovation, and has a higher alcohol content and thus a longer shelf life counted in months. However, beer took its sweet time spreading around Europe, in the early 17th century Shakespeare is still consistently dissing beer in his plays.
Cornell, Martyn. Beer, The Story of the Pint. London: Headline Book Publishing, 2003.