A vessel inoculated with yeast and other brewing microorganisms will make it harder for other microorganisms to take root. They'll be outcompeted by the large existing population. So a barrel of beer will tend to stay healthier than a barrel of water.
If someone drank say, 100oz of 2% abv beer over the course of the day, that's equivalent to 2.5 pints of 5% beer - hardly enough to get shitfaced.
Edit in response to your edit: density was lower but technology to manage density was less sophisticated as well. Providing clean water to a large population is a hard problem that people have had to solve lots of ways, and brewing is one of the solutions. Later, an infected city water pump led to the invention of modern epidemiology.