I don't think it was ever confirmed onscreen, but in-universe Kirk had orders to explore and investigate Class M Earth-approximate planets.
So maybe not just convenient that we always saw the Enterprise stumbling across Class M planets. It seems those were the ones the ship was sent to explore. Or something.
From Gene Roddenberry's original series outline, as quoted in TMOST
(Excerpted from orders to Captain Robert T. April)
. . . VI. Consistent with the limitations of your vessel and equipment, you will confine your landings and contacts to class "M" planets approximating Earth-Mars conditions.
So . . . yeah. It was part of the concept from the beginning that the Enterprise
would be mostly limited to exploring Earthlike planets, obviously for budgetary reasons.