Roddenberry wanted a post capitalistic society with no currency. That's what he wrote, and the few things that did revolve around scarcity economics were things that weren't subject to straight economic deals. Dilithium was rare enough that an unlimited supply couldn't be put on every ship, so if something happened they would need to acquire more unexpectedly, but it wasn't just traded on the NYSE.
The "problem" (from an analysis perspective) is that Roddenberry didn't go on record with enough details. He would sometimes come down on a story that involved economics, but not always, and didn't lay it out in an explicit "this is how their system works" setup. This is fair- he's positing a warp drive, transporters, invisibility cloaks, and several types of lasers and states of matter, it's by no means impossible that an advanced society would have solved economics by some method as well, and it's unfair to expect him to deliver a detailed economic model for a post scarcity society - it's interesting to claim that one could exist, and write stories in that world.
So when people in this thread point out various inconsistencies, or point to specific times where "federation credits" were used, or whatever, the fact is that the ramifications of those plot elements were not considered by all the writers, and often not really "meant" to describe a coherent system.
But here's what we do see consistently:
We see that there are some private citizens who have their own ships, and some that simply work jobs that aren't well respected or all that interesting.
We see that the Federation has a lot of ships, but they aren't war ships, and they aren't preposterous in numbers normally.
We see that the majority of Earth and other core worlds doesn't own starships. We also don't see flying cars or privately owned skiffs or whatever.
We see that there's some mechanism for gearing up for wars- the Federation absolutely has to fight wars at times.
We see that energy is thrown around trivially in most cases, but not in all cases.
We never see anyone going hungry if they are anywhere near functioning civilization.
We don't see anyone rebelling or fighting the Federation in a way that we can really sympathize with. The closest we get to understanding their position is mindless revenge, and mostly it's useless external conquest.
We don't see signs of over or under population.
It stands to reason that there's some manner of rationing going on- stuff isn't infinite. It stands to reason that almost everyone is ok with the state of affairs, and that they feel represented or are otherwise ok with stuff. If we go with Roddenberry's "there's no money" position- and I think that's fair, because that was one of his overriding design concerns- we're left with some kind of command economy that leaves some amount of resource distrribution as discretionary, and has enough resources that this finite limit is totally reasonable for essentially everyone. No one is busy *championing* a different form of government- there's no group of capitalists in Newest York or whatever claiming that the Federation will do better if it only really puts the squeeze on people, or something.
Now, for him to claim that this space computer communism is effective would require diving into all manner of crap, and that's what this thread is about. So I'll answer the question:
Yes, it could work, but not without a serious understanding of how individual and group psychology works. Not without a serious understanding of what motivates people. I don't think we really have that, because most of the studies in these areas are set up to fight battles politically, not uncover truth- and certainly not to figure out what's going on for any reason other than maybe advertising to people more effectively. Everyone we see in Star Trek ranges from highly talented and trained to ludicrously talented and heroically experienced- is education really that good? Is it really that capable? In the real world, people don't just seek money to acquire power over others, or whatever else, they use money as a way to improve the world around them, or get laid, or help their children, or whatever. Star Trek plots don't normally ever touch on this stuff in detail, because they would need to flesh out an alien and complex economic system and social values structures to tell the story, and those aren't the stories they want to tell anyway.
We're as far from understanding how a Star Trek science-fictional economy works as we are from understanding all the other science fiction in Star Trek.