I have heard that AVG does this as a service to their paying business customers. The idea being that the less viruses home computers are infected with, the less likely their customer's computers will get infected.
Of course, AVG, which I prefer, like many others offer premium upgrades that do cost money. The free packages are in essence loss leaders that help drive business.
Other software projects are open source projects. That is, the source is available for all to see. The idea being peer review makes for better software. I agree with that sentiment. In these cases, it's difficult to make the source code available to everyone and not make it free.
However, people still make money from open source software. To meet their specific requirements, businesses pay programmers to maintain the software and they pay for support contracts and other services from the vendors that maintain the main branches of the product.
Most PC users are able to benefit from all of this by using all of this free software.
You can find freeware and open source software here:
http://www.free-software-catalog.com/