Replicators can create anything except a living creature.
The Federation has virtually unlimited energy resources, courtesy of matter/antimatter annihilation.
So, tell me - what standard of value would the economy be based upon? Other than some kind of fascistic rationing of energy or restriction of access to replicators, what prevents anyone from having anything
It's funny that after five or six years of just dodging the question the writers had to invent latinum and claim that it wouldn't replicate for some technobabbble reason.