A state can't. The only thing standing in the way of prosecution is restraint on the part of the feds. Most laws are selectively enforced anyway.
Feds seize $1M in marijuana from Boulder County grow, raid Nederland dispensary - Boulder Daily Camera, 21 November 2013
Question:
You’re working a job that requires you to submit to random drug tests. If you smoke the weed in Colorado and test positive for a legal substance (weed) is your job at risk in Colorado?