SAN FRANCISCO—A unanimous California Supreme Court on Thursday struck down a law that sought to impose limits on the amount of marijuana a medical patient can legally possess.

The California Supreme Court ruled that state lawmakers were wrong to change provisions of the voter-approved Proposition 215. The 1996 measure allowed for patients with a doctor's recommendation to possess an unspecified amount of marijuana.

The...