This is a "if a tree fell in the forest" type of question. In reality whether it is illegal or not, people lie all the time when they visit the doctor and I don't know if anyone is ever prosecuted. People lie about back problems to get viocodin, oxycontin, etc.
I suppose there are laws on the books about obtaining medication by fraud or deceit, but to prove the case would be difficult, especially a marijuana card. Why? Because I suppose if a person went to 20 doctors scamming all of them to get a supply of narcotics from each doctor, that may alert the authorities, but here the patient can grow the marijuana undetected.
My point is question suggests something that would not be reality.
Now the other reality, a cop lies to get a MMJ card so he can bust the dispensary - he is likely committing some crime, but he may have immunity to do so because of the law enforcement function he has.
The above information does not establish an attorney client relationship nor is it meant to provide legal advice.
Well, the interesting thing is that your statement "may" be considered to be privileged as it was made to your doctor in order to get a diagnosis. The doctor/patient privilege "may" possibly be asserted because the crime is past and is not a future crime. Understand that if a doctor, priest, attorney, or someone else learns of a crime that you anticipate to commit in the future, it might not be so protected. Understand that this is merely one "possible" argument.
Others, especially DAs, would argue that you should be charged with obtaining a drug under false pretenses - just as someone might forge a prescription or modify a prescription to provide more pain medication for themselves from a doctor is a felony offense.
As with many aspects of the law, it could be interpreted and argued either way and that is why we have trials and lawsuits. However, you should definitely understand that you are treading on thin ice and seriously looking at being charged with a felony for procuring marijuana illegally.
The information provided in this answer does not create an attorney-client relationship. If you are interested in his legal services, feel free to call Chris at (303) 409-7635 at his law office in the Denver Tech Center. All initial consultations are free of charge.