Article I, Section 8: "...and to exercise like authority over all places purchased by the consent of the legislature of the state in which the same shall be, for the erection of forts, magazines, arsenals, dockyards, and other needful buildings;" That restriction if for land purchased from the state. Where does the Constitution restrict land owned by the government before the state was created?
You are correct, that section assumes the state is already a state, otherwise the land could not have been bought from it by the feds in the first place.
The question then is, what does the Constitution say concerning how States get created and added?
Did it have provisions for territories being created first, and then States?
And how is it that the Midwest States, from Oklahoma up to the Dakotas, have less percentage of federally owned land than the States to the west of them?
(Texas was its own nation, thus the tiny percentage of fed owned land there)