Despite the industry's precarious legal status, investors are flocking to states where voters have legalized cannabis.