The idea that Medieval people drank beer or wine to avoid drinking bad water is so established that even some very serious scholars see no reason to document or defend it; they simply repeat it as a settled truth. In fact, if no one ever documents the idea, it is for a very simple reason: it's not true.And so on.
Not only are there specific – and very casual – mentions of people drinking water all through the Medieval era, but there seems to be no evidence that they thought of it as unhealthy except when (as today) it overtly appeared so. Doctors had slightly more nuanced views, but certainly neither recommended against drinking water in general nor using alcohol to avoid it. . . .
Gregory of Tours (sixth c.) writes that when one man "arrived at a village by the road, he went into a small habitation and asked there for water." He even favorably mentions a pond – that is, still water – as a source of drink: "In the middle is a large pond with water that is very agreeable to drink". And in one tale a merchant uses river water from the Saone to dilute wine. Gregory also tells of a crowd finding the marks where a hermit had knelt to drink water from the river. St. Lupicin is said to have drunk the water of a local stream. When a child restored to life miraculously speaks, he tells his mother "Run quickly and bring me a cup of water."
One piece of evidence that medieval people drank water is the great prominence of wells; would people have given so much prominence to something that was mainly for the livestock?