There are two categories of software : those which are proprietary and we must usually pay for their use, and those which are libre and we have no obligation to purchase.
Commercial and libre software are not necessarily opposable, and sometimes the objectives have no relationship with their differences that can be mixed according to the domain, the need, the type and the scope of a project.
In both cases, developers supply an immaterial work through a physical medium, for which they are intellectually the authors, and which takes time and investment. The purpose of a work being to live and survive, for oneself and for others, a free software is not thus synonymous of gratuitous, unless it is a public service funded by taxes.
Donations are a source of income for free software designers. Just like we are free to use these programs, we are also free to define what we give according to our means. Sometimes the authors don't ask for money for various reasons.
But the shareware donation system, outside the case of amateurism regarding few currency units, except for humanitarian work not controlled by the State, is a false and problematical litigious solution for a false cash flow problem, and from a fiscal point of view it would be more accurate to consider the libre purchasing as commercial sales when the product is an intangible deliverable, which requires to not flat rate taxing the existence of an entity and only the generated flow of money.
Developing free or open source software is a vision about source code, sharing of knowledge and evolution of computing. You can read different points of view from Free Software Foundation, from Open Source Initiative and from Creative Commons.
I consider the right and need of the source code of all software sold or distributed free of charge, and therefore not falls within the internal and legal activity of a group nor the national security, to be as free and monetizable by its producer as the text of a book because of the immutable principle that a code hidden to the public is like a book hidden to the public.