But there are opportunities in the Federation. Tens of thousands of its citizens choose to die in miserable dilithiium mines just to better themselves ...
Harry Mudd: "Lonely, isolated, overworked, rich lithium miners!
"Eve ... I'll get you a man who can buy you a whole planet."
Lastly, the real context here is exploration of space. History tells us that the capitalist and competitive US has only a limited interest in space exploration, not counting space based weaponry.
Of course in a capitalistic system, exploration is followed by utilization and exploitation of discoveries. The early space race provide America (and others) with access to Earth orbit. Satellites, weather and communications and navigation. These satellites are commercial products and generate profits for the companies/corporations that build them, launch them and operate them, and for the businesses that make use of the information and signals that the satellites produce.
One example would be that while the weather report might be a passing segment on your evening news, the images and information from weather satellites have enabled farmers to increase their agricultural output significantly.
More money, more money, more money.