Two points...
The planet is within Federation territory.
Go ahead and grab a plot of land in Nebraska and claim your a sovereign nation and see how quickly the US reacts.
Vatican City exists as an enclave entirely within the territorial boundaries of Italy (i.e. within Italian territory), but Vatican City
itself is not Italian territory and thus Italy has no legal jurisdiction within. Which brings us to:
1) Do planets no longer have sovereignty & self-determination once they join the Federation?
The Ba'ku did not have any association whatsoever with the Federation, let alone join the Federation. Their planetary system exists within the territorial boundaries of the Federation (as recognized by treaties signed by everyone except the Ba'ku), however, the planet where the Ba'ku lived, nor its inhabitants are members of the Federation, nor have they ever been.
The state of Nebraska is nationally recognized to be under the jurisdiction of the Nebraska state government, and internationally recognized as being United States territory. An area of land (or space) can certainly exist
within the territory of another government. It does not, however, necessarily follow that that area
is the territory of that other government. It's a subtle distinction, but it's not unheard of in the real world, e.g. San Marino, Vatican City (both within Italian territory), and Lesotho (within the territory of South Africa). With the vastness of
interstellar space taken into account, enclaves such as these are likely very common.
Bajor, for example, doesn't answer to the Federation. Neither did Coridan prior to joining the Federation -- Starfleet couldn't just go in there and take their dilithium and then justify it by saying there was a Federation planet to their left and to their right.
The Ba'ku were squatters.
The Ba'ku occupied this planet nearly a century before the Federation was founded and also not less than 20 years before Earth even had warp drive. If ST were real, the Ba'ku would be settling that planet right about now.
I can't think of any instance in the Star Trek Universe where a planet became Federation territory simply because it orbited a star located within the furthest extents of "Federation Space." A planet with a population on it must voluntary join the Federation to be subject to Federation law and "eminent domain" (if that even exists under UFP law). It is not the Terran Empire.
2) the So'na & Ba'ku were the same people, so the So'na had no more rights to the place than the Ba'ku. Nor the Ba'ku less rights to it.
How long to does a group have to reside in a place to be no longer squatters?
Not to mention the deceitful way the Federation, a supposedly enlightened mob, went about the whole thing.
I don't know, but if anyone within the Federation decided to call them squatters, they'd have a pretty difficult time backing that claim up since the Ba'ku inhabited the world well before the Federation existed and Earth even had Warp Drive.
So then, what is the Federation? Is it an organisation of like-minded, sovereign planets that co-operate for trade and security, a Commonwealth of Planets, or what?
It is, literally, a Federation -- a sovereign state consisting of partially self-governing states united by a central government (e.g. The United States, Canada, Australia, Russian Federation). In the case of the UFP, each member's government voluntarily joins the Federation and places their planet under Federation law.
first, as pointed out below, it IS a Federation planet, which should pretty much have ended the debate right there. Heck, the UFP should've just openly removed them rather than sneaking around.
The Ba'ku world was not a Federation planet any more than Vatican City or San Marino are Italian territory. The planet, similar to these Earth-bound examples, simply exists
within the physical extents of Federation territory.
along with the first point, the PD(Which is actually also a horrible "doctrine" which I totally disagree with) doesn't apply. They weren't indigenous to that planet, they weren't pre-warp or pre-first contact either.
The Prime Directive has never been restricted to indigenous, pre-warp, pre-first contact civilizations. (TNG: Symbiosis, TNG: Too Short a Season, TNG: Redemption, TNG: The Mind's Eye, DS9: The Circle, VOY: Prototype). The inhabitants of Moab IV, in fact, were non-indigenous, warp capable, and aware of other life forms outside of their system. The
only thing that prevented the Prime Directive from applying is that the inhabitant's ancestors originated
on Earth (TNG: The Masterpiece Society).
Are you such an absolutist when it comes to property rights that you think the squatting claims of a tiny village outweight the potential benefits to BILLIONS that the planet's resources would've brought?
Unless you are stating that "The needs of the many outweigh the needs of the few" is justification for the Federation to invade any inhabited planet that has needed resources (which is against what the UFP stands for), then you must still be working under the erroneous assumption that sovereign conclaves don't exist and that the Ba'ku homeworld itself was Federation territory simply because it lies inside the physical extents of Federation space, or, put simply, that the Federation is an empire that conquers planets simply by existing.
let me turn Picard's question around. How many does it take before it becomes RIGHT? Would you oppose removing fifty Baku settlers to get at the resources?
This question still assumes that the Ba'ku homeworld itself is Federation territory, which it is not (see above).
what if it was one guy who'd crashed there three hundred years ago? Would you still oppose removing him?
No, I wouldn't. I see a distinct difference between a thriving society built by a civilization of people and a single person living in what's left of his space ship.
EDIT: Hell, the Federation got thrown off of Velara III, a planet within Federation territory, by the indigenous SAND (TNG: Home Soil).