The classic problematic rationale, that the court discusses in cases like Printz [1] is also dislocation of the political costs of enforcement away from federal officials onto state officials.
2. Enforcing it at the federal level costs money. It's easier to pass a ban where you force the states to pay the costs.
In addition, the Ninth Circuit has held that Congress has Commerce Clause authority to criminalize possession of homemade machine guns.
Congress has chosen to allow states to regulate gambling to a certain extent, which explains its legality in various forms in the various states.
To transfer enforcement costs, including for hosting civil actions outside of the situations where state law claims get into federal court, to state law enforcement and courts.
Maybe one way of summing this up that makes more sense of the distinction is this: Congress can make laws that regulate behavior as a general matter (subject to other constitutional restrictions), but cannot regulate directly the behavior of state governments themselves.
It's unusual for congress to do the former but not the latter, but that appears to have been the case here.