Right, but a doctor is bound by the Hippocratic Oath, and because the recommendation, specifically, for cannabis has legal implications (i.e. the patient can now purchase it under the law), a cannabis rec has similar ethical considerations as a prescription.
However an opinion is not. Thus building a moral barrier there.
Some other opinions that many doctors have: everyone should drink more water. Everyone should exercise. Many people will get this advice/opinions without a prescription for such.