The federation is a post-scarcity socialist utopia. They don't even have money. Every single human being has ensured healthcare, housing, food, and education of their choice guaranteed from birth. Rise among ranks of the few hierarchical power structures is based on merit, performance, experience and training. I can't recall anything specific about the productive sectors that allow this to happen, but since they have access to virtually infinite amounts of energy and everything can be done by machines and matter replicators, there's no motive for hoarding means of production or wealth, so one would assume that most productive endeavors and enterprises are collectivists by default. Same with political institutions as hoarding power doesn't guarantee anything significant beyond what the average person already posses. They also have wide social openness, tolerance and acceptance as the most common sources of intolerance and bigotry (wealth, religion, power, prestige, etc.) have been regulated or removed. So there's no logical point on slaving, discriminating, oppressing or exploiting any particular class of people, some classes of people might not even exists, as there's no concept of poverty, nor race or sexual discrimination in the culture of the federation.
As a result people don't have to work, but most probably choose to involve themselves in some sort of productive activity as a form of hobby. Members of the Starfleet for example, aren't doing so for any particular material incentive. But do it because they think space exploration is neat, or because they seek glory and honor on the Starfleet mission, or because they really really like fusion cores.
They are as socialist as it comes.