Colonizing distant M-class worlds was no easy matter back in Kirk's era. How many dead or struggling colonies did the Enterprise visit back in the day? How often did we hear about plagues and famines and dangerous radiation? Judging from what we saw on on TOS, the Federation wasn't exactly drowning in safe, danger-free, uninhabited M-class worlds . . . which were valuable enough that the Klingons wanted them, too, and would go to great lengths to claim them.
Sure, we saw lots of M-class planets on TOS, but most of them were already inhabited and protected by the Prime Directive. And they were often harsh and forbidding.