That was my whole point: they have an economy that makes stuff for free.
How can you get people to sacrifice time doing something unpleasant when stuff is free?
Add to it the fact that if someone doesn't do it, the stuff isn't free. Once it's done it is free... so their work benefits everyone exactly as much as it benefits themselves (public good). So how would they induce someone to do it?
It's a quandry.
They've tried to explain it as being motivated by challenge and personal improvement. The main instance was Picard explaining to the investment banker they found frozen on the lost cryonics satellite that things were different now.
And life right now abounds with examples of that already. People who enter law enforcement or the military or other arenas where it's the "love of the job", protecting others or simply "service", when they could make much more and have much more personal security doing other things in the private sector. True, many in our volunteer armed forces may serve due to a percieived lack of economic opportunity, but within the military there are still plenty of postings and duties that require extra training, effort, and a disply of profficiency to attain. And the financial compensation is generally in no way commensurate to the risk.
I suppose Olympic athletes could be doing it for the multi-million dollar endorsements if they medal, but most must know they won't.
Astronauts overlaps with the military example to a great degree, but most all of the civilian/scientists-engineers and military scientists-engineers usually could make more doing things using their knowledge in the private sector as well.
A doctor who works in a free-clinic rather than a suburban hospital etc.
The Star Trek "handwavium" comes in that they somehow explain that most ALL of Humanity now has this attitude to varying degrees.
It also occurs to me that they've dropped plenty of hints that just like today, a premium is often placed on antiquities, original art, "real" food, or other objects or experiences that have a cachet to them due to rarity, irreproducibility, historical and/or artistic significance. And the way to most fairly distribute such limited goods and services is through a capitalistic system and various commercial entities to compete to provide them. It's just that that system has split from the procurement of basic needs.
For instance, with modern movie theater and sound-system technology, it's perfectly possible for a nation to have ONE ballet or symphony orchestra, and everyone can just watch it in their home city much more cheaply and efficiently. However, no one is making a move to implement that. Of course people who are interested can view or listen to such content on stereos and television in their home, but there's obviously still a premium placed on seeing such a performance in person. Which is good, because every major city having a symphony or ballet company better serves to absorb all of those who aspire to be musicians or dancers.