Star Trek was pretty inconsistent with money. Riker often gambled for money, and they certainly treated specific items as "valuable" (historical items, weapons, and especially liquor.)
I think some of the writers just didn't know how to picture a post-money world. But by DS9 they mostly treated things like latinum an inter-species trading valuable (especially to/from the Ferengi) or just something that's needed in the outskirts of the Federation.
and they certainly treated specific items as “valuable” (historical items, weapons, and especially liquor.)
Historical items definitely have non-monetary value. They can't truly be replaced since, no matter how accurate the replica, only the one chair will be the Enterprise-A's captain's chair, for example. Replicators have software restrictions on what you can make with them, so you can't just replicate weapons under normal circumstances, which creates scarcity and gives them value. Starfleet replicators also seem to be restricted from creating alcohol, which means most of the characters we see can only get it on shore leave, which also creates scarcity and therefor value. Alcohol is probably significantly less scarce when sourced through civilian replicators. The ones on DS9 are programmed with Starfleet's restrictions, though.
That's my point though. They don't really address how McCoy got the glasses he gave to Kirk in Star Trek II. Did he buy them? Did he just ask someone for them? Did he barter for them for services?
Same thing with alcohol, some people pull out alcohol they obtained through some back alley, black market deal. But what was traded for this black market alcohol?
Complete tangent, it's probably not too hard to get around the limits of a replicator if they prohibit or limit alcohol. Presumably you could have it create all the supplies needed for fermentation and make your own batch.
It would take a bit, but you'd have as much as you'd ever want.