A person who possesses a prescription drug may legally possess a firearm provided federal law recognizes the drug as having a medicinal purpose.
Marijuana is a schedule I drug. Therefore the feds don't recognize the legitamacy of any prescription for marijuana.
I don't want to argue the merits of the law. You don't have to agree with the law to recognize it's effect.