It was a poorly written law. Support for legalization nationwide is currently about 55-59% in the abstract, but on any given law it's rarely higher than 50%. Prop 19 was an especially bad law for a variety of reasons, and even then it came very close to passing.