Star Trek shows us a brilliant future where there is no hunger, no crushing poverty, and in general no want in any person. Everyone works not for their own gain but for the gain of humanity and the galaxy overall. Resources are plentiful and the only impediment is the time it takes to assemble whatever it is you're trying to make.
And that is where Star Trek falls apart. Who mines the ores?
I'm not focusing on miners exclusively, by the way. All the extremely unpleasant jobs, who does them? Not to mention hazardous. Mining an asteroid for steel (and all the other treknobabble metals and minerals) cannot be a safe and happy experience.
And people are undoubtedly forced into those occupations. Show of hands: would you rather tend a vineyard or pick at some rocks deep underground? Yeah, thought so. In Trek Society, anyone can be anything they desire and there's supposedly no impediment to pursuing whatever career choice you pick. But someone has to mine. Someone has to clean the Interstellar Porta-Potties. Someone has to scrap the roadkill off the deflector dish.
They would have to be forced to. Now, the Federation cannot come out and march people off to the Slave Mines, it would break the illusion of 'the world is perfect and you can do anything!!1!'. Instead, they probably would carefully filter specific colonies and saturate them with propaganda designed to brainwash the unknowing inhabitants into believing that slaving away at the asteroid mines is the bestest thing ever. You won't get paid, but you will get free synthesized food! And medical care, which will ensure you'll be able to work out 120 years and sniff out all that dilithium crystal. Yes, life is grand, isn't it? Who needs to see the sky, anyway?
Disgusting, no? Even more when you consider that this is all to the Federation's benefit. They get all the products for free. The only expense is powering and the minimal maintenance to run the food/med/etc. machines to keep the miners happy.
The Federation is one of the great evils of the galaxy. What else do you call state sponsored slavery?