Well, the mere fact of the state legalising something doesn’t automatically make it morally OK of course (obtaining a legal abortion being an example).
As for having a prescription for it - not all doctors are bound by a Catholic sense of morality either. So the mere fact that a doctor might approve also doesn’t make it morally OK. Again, example being the fact that a doctor might be happy to perform an abortion for you.
What it boils down to for me is that you can’t do something that is wrong merely because it achieves some good. Catholicism does not subscribe to an ‘ends justify the means’ view of morality.
It wouldn’t be morally OK to get drunk in order to get rid of a headache, for example. Getting drunk is plain wrong, and the fact that some good comes out of it additional to the harms wouldn’t, so it seems, make it OK.
Fact is for all your attempts to equate alcohol with cannabis they are morally totally different categories. Responsible use of alcohol is not only permitted but encouraged in scripture - whilst drunkenness (intoxication) is of course warned against.
Not least its responsible use is endorsed by Our Saviour’s own examples at Cana and His command to drink at the Last Supper. There are legitimate pleasures to be got from responsible drinking. Many people enjoy their wine or beer or spirits for their
taste, as they enjoy their food, and not simply for the alcoholic or intoxicant effect.
There is simply no indication that cannabis is remotely in the same category morally speaking, nor any firm teaching that any use of it in any amount for any reason.
If you took a toke and it did NOT give you a high most smokers would consider it a waste, no? At the very least you certainly wouldn’t be enjoying it for any of the legitimate reasons associated with alcohol - for its taste or anything. And using it medicinally is, as I have indicated above, fraught with problems morally. You certainly couldn’t get yourself drunk for medicinal purposes, so I wouldn’t concede that it would be OK to use marijuana even medicinally.
Remember the section of the Catechism contains a blanket reference to drugs, including the legal ones as well as the illegal. So it may well not mean that it’s OK to use drugs that have the proven harms of cannabis for therapeutic purposes, even if legal. Certainly use of legal drugs (as with other legal medical treatments) can of course be abused or immoral in certain situations.
Bottom line - cannabis does NOT have the Saviour’s explicit endorsement of its use. So we can’t lump it in the same category as alcohol.