Suppose you want to go to a concert, in person, rather than watching it in your personal holodeck or whatever. There are a limited number of seats. Who gets those seats? That's easy: tickets cost money.
That exact situation is a major plot thread in Iain M Banks' Look to Windward. Banks' "Culture" is a galactic post-scarcity civilisation (and far more technologically advanced than the Federation in Star Trek), but that doesn't mean that they don't need money.