A California appellate court on Tuesday overturned five men’s convictions for possessing cannabis while in prison