My issue with the Star Trek utopia dream was always the lack of realism which so many people now with AI/Robotics/Elon praise overlook.
There's limited resources no robot or AI can overcome. If we all have the same basic income (actually why even bother with money if everyone has the same? But whatever) - then who decides who gets the 8 bedroom villa overlooking the ocean in a nice warm sunny climate and who gets the shack behind the wodden old house in ice cold dark forrest?
Who gets the old rusty bicycle and who the new Ferrari?
I think if one looks beneath the veneer there's far greater inequality than that. The typical human issues are regularly hit on in the show. I mentioned [1] one great example above in the episode Tapestry. But even more broadly than that consider lifestyle differences. Right now on Earth the lifestyle between a billionaire and an average person isn't all that different. They have nicer stuff and more influence, but we live lives that are still roughly the same. The endless hedonism people think they'd engage in if they had billions gets old fast.
But now imagine on the Star Trek universe the difference in lives between somebody in Starfleet and a regular 'peasant.' You have this class of people out there exploring the universe, making amazing discoveries, and pushing the boundaries of humanity in every way. And then you have the peasantry back on Earth doing Earthy things. The difference in these lives would be dramatically more stark than now a days, to the point that they may as well be two different species. Come to think of it, that could literally happen since Starfleet families would likely disproportionately beget Starfleet children and so on. And these differences in environment/family would create radically different classes.
In reality there would likely be major class protests, claims of nepotism, calls for Starfleet to be 'more inclusive', and so forth. In short order everything would start rapidly descending into disorder.
Fair questions.
But we answer those at the moment with equally inadequate answers: your parents owned the nice mansion, so you get it (though that also includes "so your older brother gets it" just to be really unfair). Also on the other end of the spectrum: your parents messed up your education and traumatised you, so no mansion for you.
It would be good to work out some system that could answer these questions on a better basis than that.
I think your first question is answered by your second. The main reason for a radically egalitarian Star Trek utopia to have money would be to allocate scarce resources. The shack and the 8-bedroom villa have very different supply and demand curves, so would have very different prices.
There are other problems that get glossed over in a Star Trek utopia, and there are other ways of allocating scarce resources than a market economy, but I don't think your objection really holds.
The winner of the “Mansion Games”!
You do the same as you do with Ren Faires and whatnot, by definition you're the lord or lady or knight and someone else is the peasant with a fascinating collection of skin diseases in soiled rags who gets to eat warm mud for dinner.
Wealthier societies have fewer babies - it is likely that earth has a lower population in the 24th century than today. So the resources are less limited, and technology solves other scarcity issues. Everybody gets a Ferrari. Also, humans have settled other planets, so you could always just move to one of those.
Of course, it’s science fiction, not reality. We’ve seen how communism works in the real world, so I’m fairly skeptical of the Star Trek future. 350 years doesn’t seem like enough time to fix all the things wrong with our society.