When our forefathers created the Constitution, they did so with a great eye toward freedom and unfair prosecution of crimes. As such, they laid out some very specific amendments that help you guarantee those rights. But it is up to you to protect them--not up to the cops who are investigating a crime.
Medical marijuana is legal in California - except when it isn't. This is the situation people face when they are charged with a drug crime when they are just seeking relief from a medical problem.