Well there are certainly some glaring problems with this episode.
"Buying" an entire planet? I'm sorry... but from WHO? So we have to imagine that there is some species heavily populating an entire solar system, enough to claim ownership of all the planets within it. And then a perfectly habitable planet that they haven't bothered colonizing yet could be sold to someone for the "right price"? It's laughable .
I'd say the Federation via Star Fleet took physical control of a vast swath of solar systems that were totally uninhabited. The government says "This is ours because we got here first. And now we'll sell the acreage to our citizens so the new lands will be developed and put to productive use, and incidentally increase the chances that we can hold the solar systems we've claimed and someday levy taxes on them."
In STAR TREK's founding proposals, Roddenberry knew that planets with life would be the exception.