States are not territories.
Article I, Section 8, Clause 17 addresses land within states.
While we do not undertake to say that Congress has the unlimited power to legislate against nuisances within a State, which it would have within a Territory, we do not think the admission of a Territory as a State deprives it of the power of legislating for the protection of the public lands, though it may thereby involve the exercise of what is ordinarily known as the police power, so long as such power is directed solely to its own protection. A different rule would place the public domain of the United States completely at the mercy of state legislation. Camfield v. United States (1897) US Supreme Court [Emphasis added].