I get the impression that the replicator reduces the need for as much specialization, and improves the efficiency of industry by reducing specialized products (eg, you don't have a thousand stem bolts sitting in a warehouse because the market dropped out, you use the replicators to emulate the Japanese 'build on demand' acquisition methodology).
At the same time, it's not magic, because you need trace elements, and they establish that there are plenty of things that a replicator will not create or do on its own. For example, there's a need for dilithium crystals, right? They can't replicate them, they have to mine them. Something about 'gold pressed latinum' exceeds the ability of the replicator. It stands to reason that there are LOTS of things the replicator can't do, and I note that for the most part, they show it making food and... that's about all. There's the occasional reference to using it replicate a broken part, but that's really rare, and there have been plenty of episodes where some piece of equipment needed to be physically gotten (like when they scavenged parts off the other space station that looked like Deep Space 9). Presumably, replication is both limited in ability and expense with energy, otherwise they would just have big starship replicators that pump out any sized fleet needed.
...which they don't. It's been repeatedly shown that the process of building a starship is extremely man/woman/critterpower intensive and takes a long time. The fact that the starfleet exists proves that in that universe, there are shipbuilders doing the work. It stands to reason that foodstuffs are grown as well, as established on the 'Trouble with Tribbles' episode. As you recall, Shermans Planet was facing famine, and the plot revolved around a cargo of grain.
I think that the replicator for food is akin to eating MREs. Out in the field, you can eat canned stuff and MREs and whatnot all you want, but it's not feasible for large scale populations. 99.99% of the people we see eating from replicators also happen to be military, so it stands to reason that the added expense of using replicators (which also have strategic purposes) is worth it for whatever reason. Quark has one in his bar, but he's on a station that's presumably far from food supplies, so that use of the replicator is consistent too.
I think Seagoon is right about the socialism with the small s, but that's not the same as communism, and who knows, maybe their specific lack of detail on those regards allows them to say 'some new economic policy that we don't know about yet' that's a mix of stuff we know.
I get the impression that the Federation's economy is deliberately vague for a reason, so it doesn't get in the way of the story. That said, assuming that the federation DOES follow a socialist model, all is not lost. The Ferengi appear to represent capitalism without conscience, but even when you're cringing at the scheming those big eared guys are doing, you can't avoid the results. On DS9, Quark was able to get stuff nobody else could. If that isn't a subversive way of saying that feddy socialism isn't the end-all answer, I'll eat my hat.
In the end, I'll fall back on the most important point: Star Trek is not a book written by a person with a mission. Roddenberry might have started it that way, but it's the culmination of hundreds of writers, each with different backgrounds and opinions. As a consequence, reducing it to 'liberals in space' is a bit disingenuous.