We could argue that star travel simply isn't particularly expensive in the Trek universe: building a warpship may take resources, but operating it could be dirt cheap, with fuel costs approaching zero (hydrogen is everywhere, the Federation turns some of it into antimatter using some kind of free energy such as sunlight, and it is in the Federation's interests to sell the antimatter at very low cost to promote trade).
Similarly, Kirk may be exaggerating the costs of operating a frontier colony. It is only at the extreme fringes that you need support and protection, because the Trek galaxy is so full of worlds that already provide for your every need that even potential pirates just plain don't bother with attacking a colony for its resources; they can get those more easily and cheaply from a world without a colony. (Indeed, we hear of criminal raids on colonies only about as often as we hear of criminals setting up
a colony to run a slave mine or the like!)