Well, no need to write this article anymore. Gabriella Cordone has done an amazing job researching the monetary inconsistencies in the series, and explaining some of its economic problems in this article, a translation of the original in Italian. Quoting her:
Let’s start with the Roddenberry rule. No money in the Federation! Easy to say... not so easy to do. ...
When TNG arrived on the silver screen, the Great Bird of the Galaxy Gene Roddenberry had been deceased for several years, but apparently his rule kept following his characters; at least that seemed the intention. In Star Trek: First Contact, here comes Captain Picard again, who talks with Lily and, answering her question about the Enterprise: “How much this ship cost?” he answers “The economics of the future is somewhat different. You see, money doesn’t exist in the 24th century.” “No money? You’re telling me you’re not paid?” Lily is surprised. “The acquisition of wealth is no longer the driving force in our lives. We work to better ourselves and the rest of Humanity.” Despite Lily’s surprise (that mirrors the whole audience’s surprise), the line does not leave doubts: money does not exist and it’s not for money that you work. Picard and company are explorers and the risks they run are no different from those ran in the past by people like Amundsen or Livingston. The prestige of making a discovery exists since ages ago, the honor of being the first to know something and bring back the knowledge to the rest of humanity is drive enough for men like the Federation officers.
This is the lesson Roddenberry wanted to give, saying that in the Federation there was no money, word by word. ... What’s not clear enough, though, is the question Picard doesn’t answer: how things are done when a workforce is involved? Lily had difficulty in putting together the metal needed for building the capsule of Cochrane’s rocket, while apparently the metal needed for the Enterprise costs nothing... Let’s assume that miners do not exist and any heavy work is not done by men. But there must be - along the process of building a starship - some boring job that men have to do and they might do only for remuneration. So what, if not money?