In First Contact, Picard tells Lily that 'the economics of the future are a little different' or words to that effect.
Personally, I'm just going to have to take his word for it because the economics of Trek have never made much sense to me. On the one hand, you have virtually limitless energy available in the form of fusion power and anti-matter reactors, with replicators that are essentially 'magic' 3D printers that can recreate just about anything. So, food? Readily available. Shelter? Replicate all the apartment buildings you want. Medical care? Given the state of technology in Trek, some form of 'socialized' medical care is probably possible and economically feasible- what form it actually takes remains a mystery.
On the other hand, you have stuff like the Ferengi, Quarks, non-Federation worlds, and oh yeah: property rights. The Picard family owns land and a vineyard in France. Sisko's dad owns a swanky restaurant in New Orleans. So what if Rocket Raccoon shows up and wants the Picard vineyard more than ol' Robert? I mean what if he really wants it? How does he obtain it? Does Sisko's dad serve up all that fine Creole food (hand made- not replicated!) for free? Where and how does he get his ingredients? So on that level, there needs to be some form of currency or means of exchange. Some form of dual-layer economy would seem to be the answer, but nobody has really ever bothered to tackle this deal in Trek- at least not anywhere I've seen or read.