In Georgian times, around 1800, coal-based industry gets under way, there's a population explosion, and many cities have properly horrific slums, latrine courtyards ankle deep, families living with pigs in wet cellars, graveyards overflowing ex-human slurry into the street. This is also when we invent bottled water, and if you can't get that, beer is a good option for safety reasons.
But in calmer medieval times, avoiding the local water can't have been so crucial, because the locals probably knew where to get the clean-ish stuff (however harmlessly brown or wriggling).