The first principle of economics is: Everything has a cost. This applies equally well to financial, political and social economics. It’s the very foundation that the current form of our society is built on. It’s a common misconception that cost can only be paid with a monetary price, such as money. But ultimately cost can be paid with other things.
Free software is software that respects users’ freedom and the community around them. Users of such software are able to use, copy, distribute, study, change or improve the software. “Free” in this case refers to the freedom, not the price, of the software. “Free software” does not mean “non-commercial”. A free program must be available for commercial use and it can cost money. In fact, commercial free software is a very important part of the ecosystem.
Many things in life are “free” in this sense (remember we are not talking about the price). Concrete things like furniture and cars or more abstract things like scientific research all have the aforementioned freedoms. You can use, copy (if you have the tools), distribute, study, change or improve these things as you like. Would you ever buy a table that you’re not allowed to re-paint? Or buy a car you’re not allowed to change tires on? I don’t think you would.