Aramis,
Sisko's father in DS9 owns and operates a restaurant in New Orleans. Do you think he let's people come in and eat for free? Does he just order supplies, flour, sugar, shrimp, etc and not pay for it?
What about all the merchants and traders (C. Jones in ST:OS, Merecks ship in ST:OS, Sisko's girlfriend/wife in DS9, etc.), do they just transport cargo from one location to another without charge and expect to obtain replacement parts for defective ones without paying for them?
If the Federation isn't capitalistic then it has to be communist in economy. Communist economies when in contact with capitalistic economies, based on history, tend to fail due to inefficient distribution, corruption, and mismanagement. If the Federation is surrounded by capitalistic societies, Ferengi, Cardassians, etc. there would be a loss of personnel to these other governments by the people desiring to improve their status and their children's status in life. Eventually the communist government can't compete with the capitalistic one and fails. That's what happened to the former Soviet Union and Warsaw Pact nations. China and other "communist" (dictatorship) states began reforms to introduce capitalism, primarily to avoid the fate of the Soviet Union. If they don't reform they become economically isolated and eventually fail unless they are an extremely oppressive police state like North Korea (which has recieved considerable help from the Chinese).
The creators/ developers of ST wanted to present to their viewers a future utopian society where there is no racism, greed, corruption, hunger, povery. But utopian societies are idealistic, existing only in the imagination. As long as humans suffer from the frailties of greed, jealousy, and envy there will never be a utopian society as depicted in ST. People of the future might have gained some wisdom and learned not to heavily indebt themselves in order to avoid financial difficulties but that is much easier to do than eliminate greed and envy.
IMO