If the federal government is holding that land illegally then how can they legally sell it?
There is nothing in the Constitution that prevents federal land ownership. And this would issue can be solved at the stroke of a pen by Congress passing legislation selling land the government does own back to the states. Problem solved.
A factor most folks ignore is that all those lands need to be policed, and states universally prefer the Feds to do that.
It costs a lot, and if we do not police those lands, criminals will quickly identify them as great place to do bad things, like manufacture meth with impunity.
They already do that, but sooner or later they get caught.
I have run into some shifty characters on BLM land, with no one around for many miles, including Mexicans shooting guns and who seemed hostile to me.