You can drink beer, or vodka, or both, and buy a gun. Heck, you can even drink a beer, have a shot (or two), and directly walk on over and buy a gun. Nothing wrong with that.
But if you have a medical marijuana card, forget it. You can't buy a gun. And the Ninth Circuit holds that doesn't violate the Second Amendment.
Now, practically, the decision doesn't actually mean much. The person who's selling you the gun has to know you have a card before they're obligated to refuse to sell you the weapon. Moreover, the form that you fill out to buy a gun doesn't actually ask you whether you've got a medical marijuana card; it instead asks "Are you an unlawful user of, or addicted
to, marijuana or any depressant, stimulant, narcotic drug, or
any other controlled substance?"
So, realistically, as long as you answer "No," and as long as you don't (stupidly) show your medical marijuana card to every gun dealer in the area, this particular rule isn't going to stop you from getting the weapon of your choice. Or a dozen of 'em.
Still. It's the rule.