They did, and long before anyone knew about germs, scalding the inside of the water barrels before refilling them was part of the regular shipboard chores. (And of course you’ve got a pretty good chance of being rained on at some point, if you’re running low on water.)
I too had never heard that medieval folk avoided water so much as enjoyed alcoholic beverages, which you can drink in enormous quantities if the ABV is low enough. Lots of water is safe to drink but less tasty than wine or beer. Maybe we need a meta-myth-busting here, to bust the myth that there’s this myth in the first place.