They even go so far as to mention "money", literally in Errand of Mercy
Could easilly be a figure of speech.
One thing is clear. The economics of the 24th century (where O'Brien runs up his tab) are very different to pre-new-world-economy which grew in the 22nd century.
The majority of people in the Federation don't use money to grow individual wealth - wealth is grown by society, and is measured by far more than pieces of paper or promises to spend a few hours working. The 'cost' of the Enterprise E, or the 'cost' of Ayelborne's training, is as un-understandable to 80s Reaaganuts as the 'cost' of an modern aircraft carrier or a university education is to pre-agricultural people trading sharp stones for fire, at least not something you can explain in a few minutes while skulking around the ship hiding from invaders.
Try explaining High Frequency Trading to Cassius Dio. Heck try explaining it to Alexander Hamilton during Yorktown.