I can't necessarily see anything wrong with the legal analysis in this opinion. The Compassionate Use Act does indeed permit people do use marijuana for certain medicinal purposes. At the same time, it doesn't necessarily displace reasonable zoning regulations. So localities can still regulate, inter alia, the cultivation of marijuana -- as Tehama County has done here -- in reasonable ways, without being preempted by state law.
Mind you, the critical inquiry is whether those local regulations are indeed reasonable. Many, many localities have used zoning to essentially "zone out" all medical marijuana, and such ordinances do indeed conflict with the CUA. But the Court of Appeal holds that there's no such showing here, and hence rejects the petition. Reading the opinion, you can see why.
That said, I'll say this:
Tehama County has deliberately imposed quite strict regulations about the cultivation of marijuana. You can't grow more than a dozen plants unless it's over 20 (!) acres. There's an 100-foot setback requirement. You've got to surround the place with an opaque fence at least six feet high. You've got to register the place (and pay a fee), include with your registration a copy of the medical marijuana card for every patient, and potentially even have a notarized letter from the owner of the property. Oh, yeah. And you can't do any of the above within 1000 feet of any school, bus stop, church, park, etc. etc.
You can see why a county might impose such requirements. Perhaps for good reasons. Perhaps for bad ones too.
The one thing I'll add is the admittedly extralegal point that regardless of the motivation, when you wonder whether drug money is going to legitimate businesses or -- instead -- to illegal (often foreign) cartels that engage in violence, remember zoning regulations like these. The harder you make it for businesses to run a legal, legitimate operation, the more you funnel demand into extralegal avenues. And while zoning for strip clubs and the like generally work because it's very hard to run an "illegal" strip club, that definitely ain't true for running drugs. At all.
Food for thought, anyway.