Nearly 40 U.S. states have legalized marijuana use in some form but it remains illegal at the federal level.