Actually, wouldn't you expect drinking to correlate negatively with a programmer's output? Whatever bullshit people say about drugs enhancing their output, I've never heard similar bullshit about alcohol/hangover being a stimulant and if someone drinks a lot there's a decent chance they'd program when drunk or hungover.
(Personally I've tried once to program when drunk - I ate nothing the whole morning and drank half a bottle of wine, which is more than enough for me given my very little drinking experience; I couldn't stop laughing at any joke by the guy we drank with - or at pretty much anything he said, really. I did write pretty decent code in the couple of hours it took me to become sober again, in retrospect, and I think it actually gave me courage to tackle the shit I had to at that moment, but then I thought about it all a lot before getting drunk and it was almost done and all I had to do was finish it. It didn't feel like I'd do very well in general in that condition.)
Even in a startup environment with a keg in the office, I wouldn't typically drink and code, besides perhaps a Friday afternoon beer.
That said, for personal projects in the evenings, I find having 1-2 drinks helpful for removing barriers to perfectionism when you have simple coding tasks to solve.
Bingo. Implementing features doesn't usually require it, but keeping an entire system in your head with all its complexity and chain reactions from making something work another way keeps me from moving ahead sometimes -- especially when it isn't clear what the best option is. A beer or two helps me pick one and keep moving, to discover the answer as I go.
It's indirect discrimination against people with a religion that forbids drinking alcohol or people with a disability that prevents them drinking alcohol.
You can try to rationalise it, but you should be aware that you're just justifying your cognitive biases.
Try sending a woman to close a deal with a Japanese company. You're gonna get a veiled request to send the actual man in charge, if they don't consider themselves insulted and simply torch the deal. (In this instance, it was the woman herself who warned us not to do this. It was very funny, because we always brought her along as a "secretary", "assistant", etc. She was actually CTO and extremely fluent in Japanese. We got quite a bit of information because somebody said something stupid in Japanese right in front of her "secretary" act. Only one company recognized her and called us on it--we all had a good laugh making fun of the stupid old guard and wound up with the contract, but I digress ...)
Try closing a deal for defense contracting. I can't tell you the number of contracts where the signature occurred in or near a strip club. This has gotten better--it was WAY worse even 10 years ago--20 years ago it was ridiculous.
As much as it pains me, as a startup founder, I'm really not an equal opportunity employer. I'm looking for people who can fill roles that I know I need filled. If someone can't fill some important role because of religious belief, moral stance, health status, need to telecommute, inability to fly regularly, etc. I'm simply not going to hire them until I get bigger.
That probably doesn't have much to do with whether they're any good at the job or whether you like working with them.