How would a military like Starfleet manage to attract enough people into their ranks when everyone in the society has their material needs and wants satisfied with post scarcity technology. I for one would probably spend a lifetime in a holodeck trying out crazy things and living fantasies.
It's like people who retire and pick up countless hobbies, or those who can't entirely retire from the workforce because they need to do something.
A human without a job, even one that's simply a hobby, is a human that will go mad in short order. We can't just jack off all day, day in and day out, for years on end... a few weeks at a time? Sure, you might just get blisters... but after long, the itch to simply do things is irresistible.
The craving to be a part of something larger than yourself is always a major driving factor for at least some members of society, and beyond that, simply wanting to be a part of something, a team, is the norm. We want alone time and peace and quiet and all of our needs met, absolutely, but we also crave a tribe, a hunting party, glory.
I think such a society could exist... not in the same exact state as Trek would have it, but a monetary-less society with a voluntary workforce? Consider that all the menial jobs, the janitors, the gardeners, the metal shop tasks and manufacturing jobs... those will be automated. Not everyone will work, not everyone will have a job to actually get if they wanted. But no one will need one. Many will probably do part time gigs just to get out of the house, and many will simply do the equivalent of social work, as addicts would still exist who need counseling.