It seems to be common wisdom that Europeans in the Middle Ages drank primarily beer and wine because water wasn't generally safe to drink. This, however, is a rather persistent myth as water was a regular part of the Medieval diet.
Food historian Jim Chevallier examines what he calls "The great Medieval water myth" at his blog Les Leftovers. He cites a handful of modern writers who have specifically examined water in Medieval Europe, including Paolo Squatriti, author of Water and Society in Early Medieval Italy, AD 400-1000, and Steven Solomon, author of Water: The Epic Struggle for Wealth, Power, and Civilization, and looks back at primary sources from the time, which, he says, are always uncritical when they mention the drinking of water.
He notes that some Medieval writers laid out instructions on how to tell bad water from good (and sometimes even recommended boiling water that smelled iffy), and mentions one physician who recommended against drinking too much water. But there are no writers who have been known to recommend against the drinking of water completely, nor to have recommended wine and beer as a means of avoiding water. To the contrary, many writers express the thirst-quenching pleasures found in a good cup of water.
That's not to say that many folks didn't prefer beer or wine to water, and many writers of the era believed that alcoholic beverages were superior to water for promoting good health. But they didn't drink those beverages because they were avoiding something in the water. Be sure to read the entire debunking at Chevallier's blog.
Top image: Detail of people drinking, from a treatise on the Seven Vices.