I've heard this dozens of times before. But from what I know beer doesn't have enough water in it to counteract the diuretic effects of its alcohol content, making this impossible. Which is true?
Yes. But they may not have had a good understanding of why.
The important fact to remember that provides the essential background to this question is that chlorinated or ozonated water supplies (guaranteeing pathogen free water) are a very modern idea. Before clean water was available routinely, water supplies were often contaminated by sewerage or other sources of pathogens. So, if you routinely drank unprocessed water, you ran some risk of illness, often serious illness. See, for example, the story of John Snow and the Broad Street cholera outbreak (which, for some, is the foundational event of the science of epidemiology).
Contaminated water supplies have been very common since the invention of the city. So, since alcohol kills most of the pathogens common in water even at concentrations of just a few percent, there is a big advantage in drinking beer or wine rather than the untreated local water supply.
For most of the past 10 millennia, alcoholic beverages may have been the most popular and common daily drink, an indispensable source of fluids and calories. In a world of contaminated and dangerous water supplies, alcohol truly earned the title granted it in the Middle Ages: aqua vitae, the “water of life.”
...The creation of agriculture led to food surpluses, which in turn led to ever larger groups of people living in close quarters, in villages or cities. These municipalities faced a problem that still vexes, namely how to provide inhabitants with enough clean, pure water to sustain their constant need for physiological hydration. The solution, until the 19th century, was nonexistent. The water supply of any group of people rapidly became polluted with their waste products and thereby dangerous, even fatal, to drink. How many of our progenitors died attempting to quench their thirst with water can never be known. Based on current worldwide crises of dysentery and infectious disease wrought by unclean water supplies, a safe bet is that a remarkably large portion of our ancestry succumbed to tainted water.
Before the germ theory of disease was invented in the 19th century there was no coherent explanation of why alcoholic beverages were better. But you don't need theory to observe the effect. You just need to observe that people are more likely to get sick if they drink untreated water. as the Scientific American article argues:
In the context of contaminated water supply, ethyl alcohol may indeed have been mother’s milk to a nascent Western civilization. Beer and wine were free of pathogens. And the antiseptic power of alcohol, as well as the natural acidity of wine and beer, killed many pathogens when the alcoholic drinks were diluted with the sullied water supply. Dating from the taming and conscious application of the fermentation process, people of all ages in the West have therefore consumed beer and wine, not water, as their major daily thirst quenchers.
So, yes, people drank beer or wine because drinking the water often made them ill.
But beer and wine are diuretics and the question asserts that a diet of beer is impossible. This is just wrong. Just because something is diuretic doesn't mean you can't get sufficient hydration from drinking it: this would only apply if the body eliminated more water than the amount present in the beverage. This has been studied. For example, this PubMed study concluded that the popular view is wrong:
All subjects had a slight hangover, but none was fluid depleted. It is concluded that, apart from inducing changes in water balance, alcohol in this form causes remarkably little metabolic disturbance.
So, not only does an alcohol diet protect you from pathogens, it doesn't kill you from dehydration either.