Jennifer, a 37-year-old Virginia school teacher now unable to work due to unrelenting pain caused by a genetic spinal disease, stared hopelessly at the bottle of opioids her doctor had prescribed her. Beset by desperation discomfort, she faced a difficult choice. The opioids would provide limited relief but came with a high risk of addiction. Or she could try marijuana, which would likely be safer but put her on the wrong side of the law.

Jennifer chose marijuana. She drove to Washington, D.C., where the drug is sold legally,...