The second amendment does not say that private citizens have to the right to carry guns for any reason other than forming a malitia. This does not mean that the government cannot create laws that prevent certain individuals from owning a gun, based on other factors like medical history or criminal past.
I cannot honestly state that I agree with the way that the second amendment is upheld but, nevertheless, a ban on gun sales to card holding marijuana users is in direct contravention of the second amendment. Fans of the constitution should bear this in mind when the relevant statutes are brought up.
Carrying a gun or purchasing a gun while under the influence of alcohol is prohibited due to safety concerns. Marijuana is a recreational drug, such as alcohol, and impairs a person's judgment. To allow an individual to buy a gun while using medicinal marijuana can be dangerous. We can assume that the individual is using marijuana legally for treatment of an illness on a daily basis. It can a be assumed that there is a potential for that person's judgement to be impaired. This is why it is not a violation of the Second Amendment.
No, this does not violate the Second Amendment. The Second Amendment entitles the United States to a militia. This is a fair law. People with marijuana card holders and thus are likely to have marijuana should not be allowed to have guns anytime as they could be unstable and volatile.