They can, and do; there's just one wrinkle: They get the assent of the Federal government.
Take the Great Lakes Compact (please, says Nestle and Coke). It's a deal amongst the Great Lakes border states, and provinces, that decide how (or to be more precise, how not) water will leave the Great Lakes watershed. It's an agreement, not a treaty.
But as far as the several states go, you're exactly right, the states couldn't make the deal alone. They got the Federal government to sign off on it, and why wouldn't it, after all? They just went through the formality to get the Federal rubberstamp.
And the water bottling companies are up in arms, because they want to sell the water outside the compact area. They pull the same thing in California with the Sierra watershed, again, protected under a similar compact.
Now let's talk about takings aspect. Even if the state could make a law robbing a mine of its interstate customers, that is a taking - specifically a regulatory taking - under the 5th Amendment. They would have to compensate the property owner for the asset value. So here's a crazy idea. Why not just compensate the owner for the asset value? At that point, it's a consensual sale. The Feds can't possibly object. The company, owned by the state, can sell or not sell to whomever they please. Your objective is achieved, just, in the free market instead of the use of force.
Similarly, there's no question that if the State opened a gravel quarry specifically to feed freeway rebuilding projects, and ABC Paving Co. decided they wanted to buy some of that gravel for paving private driveways, State Quarry Inc. is under no obligation to sell to them.