The Interstate Commerce Clause in the US Constitution, and the plethora of SCOTUS decisions about it, has much to do with it.
Keep in mind that the court's ruling in Masterpiece Cakeshop v. Colorado Civil Rights Commission, 584 U.S. ___ (2018), 138 S. Ct. 1719; 201 L. Ed. 2d 35 (2018) was extremely narrow. The court ruled the Colorado state agency acted improperly by exhibiting extreme bias. The other constitutional issues raised in the appeal were not addressed by the court.
Keep in mind that the court's ruling in Masterpiece Cakeshop v. Colorado Civil Rights Commission, 584 U.S. ___ (2018), 138 S. Ct. 1719; 201 L. Ed. 2d 35 (2018) was extremely narrow. The court ruled the Colorado state agency acted improperly by exhibiting extreme bias. The other constitutional issues raised in the appeal were not addressed by the court.