Re: how would you build a colony?
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!)
Although you could purchase commodities and raw materials from various traders, you would always be subject to their prices and their trading limitations. If you obtained these items through your own colony, then you
possess them and control their availability. If you have more than you need or wish to keep in reserve, then you
can trade it and make a profit.
Varek, Vulcan Engineer
Infinite Diversity in Infinite Combinations
Time, like latinum, is a limited commodity.