Alcohol (in the form of beer) was - for some periods in history - more safe than drinking water. The beer making process (boiling water as well as the alcohol in it) was good at killing bacteria[1]. Bacteria in water was a pretty significant problem for towns without a proper sewage system.
(Note that you'll find some internet sites claiming this is a myth. I don't find their arguments compelling at all: most seem to argue that water was drunk as well - which is no doubt true.)
Boiling water before drinking it does have a positive effect on safety. That's beyond dispute.
I'm not one of those who claim beer was drunk instead of water - I'm just pointing out that the more positive association of alcohol compare to other drugs does have some kind of possible historic and scientific basis.
(Note that you'll find some internet sites claiming this is a myth. I don't find their arguments compelling at all: most seem to argue that water was drunk as well - which is no doubt true.)
[1] http://www.westsussextoday.co.uk/news/county-news/latest-new...