You’re conflating two different things. In the former, states have set up legal framework for marijuana sales. In the later, state laws don’t have any opinion on the matter.
A system under state law in violation of valid federal law is, because of the supremacy clause, an illegal system.