The idea that premodern and early modern people considered water unsafe is not, though. You can see this view all over the european primary record, and it's very clear that in many areas and for much of premodern history people preferred fermented drinks when they had access to the choice.
> Think about it logically, you can not brew bear from water that is contaminated in the first place.
This is also not strictly true, depending on what sort of contamination you're talking about. Heavy metal or contemporary chemical contamination won't be affected by the brewing process, but it will kill parasites for example. Bacterial contamination varies by the specifics and degree, but you may be better off having brewed it.
Securing clean springs and wells was a high priority for people all through history. Brewing is part of a range of techniques and technologies that were used to varying extents when they weren't able to.
"They drank beer instead of water because it was safe" is a myth but also so is "water was safe and there was no advantage to drinking beer."