Given Dax's behavior, it's reasonable to assume that Starfleet officers get some kind of per diem- the Federation may not believe in money, but Bajor, Cardassia, and Ferenginar sure as shit do.
I always assumed that Dax was an outlier in that gambling bit, I just can't see that being a thing that most starfleet officers do.. If for no other reason than most of them are not shown regularly doing it.
I do now suspect that Quark has some arrangement with the Federation where he's able to take up space on DS9 for his bar, use their energy for his replicators, holosuites, and even possibly some things that aren't completely sanctioned by Starfleet (such as as a mug that sings "come to Quark's Quark's is fun") mostly for the profits he makes from alien visitors that ARE required to pay, in some way.
My current thought is that Quark is required to allot a certain number of hours/rooms of his holosuites to Starfleet officers for no charge, perhaps also giving them a certain amount of free food and drinks....
Still, that kind of seems like a shitty deal for Quark, and I don't think DS9 generally disproves that...
If he gives free gambling to Starfleet though, it's got to be in the form of some BossmanJack shit, where he pays certain starfleet officers to play and (mostly) lose. So that other starfleet officers will play and lose.
The federation doesn't use money because they don't need it, but Starfleet does have their own money for their missions and encounters with societies that require some sort of money.
I would counter that they *do* in fact need money. And I think DS9 even proves that as much as is possible without directly saying "The TNG federation is stupid for saying that they don't use money".
Even in a post-scarcity civilization, everybody still seems to, if not *need* something, at very least *want* something that they can't easily get.
By comparison, the Ferengi philosophy of moving through a river of supply and demand makes a lot of sense to me than the "lul humans don't need any money" bullshit TNG tried to pull. That's probably because communism does not, and never has actually worked.
It became clear over the course of tng and ds9 that the "no money" thing is more an affectation of the core federation and Starfleet, rather than a universal trait of the federation as a whole. Less fortunate worlds, lower social classes, and those less ideologically attached to the federation ideal still use some form of currency.
It's never mentioned on screen, but on the promenade set, there's a latinum dispenser opposite quark's place that was apparently intended for use by federation officers. Federation citizens are often seen using currency, or trading in ways that imply actual economic activity rather than just hobbyists playing at merchant. Reading between the lines, there's an implication that the federation is rich as shit and that Starfleet funds quite lavish lifestyles for its officer corps, and even for its enlisted personnel.
I think you might be onto something here. But I still refuse to believe that Starfleet (in *good* Trek) would allow/encourage its officers to become "literally bossman jack" paid gamblers, anymore than I believe that that STD era Trek (if it was written well), would allow Tilly to become so fat that she has even odds in a fight with Rancor Beast from a long time ago, and a galaxy far far away.
My only question is what is the exchange rate between bars of gold-pressed latinum, and quatloos?