While Joseph did mostly drink wine and beer (and beer is actively approved as good to drink in the Word of Wisdom) this scripture still makes drinking wine “not good” so Joseph was still doing it wrong.
The bit about water being unsafe to drink throughout history is mostly a myth. It was true in some areas but most of those are cities with polluted water supplies. They drank cider, beer, and wine because it tasted good and made you feel good. I imagine a day of repetitive agricultural labor was probably easier to tolerate if you were mildly buzzed the whole time.
The Word of Wisdom is mostly pulled from the temperance movement’s standards complete with the paranoid fear that “evil and designing men” were adulterating or poisoning wine and other alcoholic beverages for nebulous reasons.