Linux, the kernel, and most distributions don't cost money because Linus Torvald's stipulated that the kernel be free in his original release of it. He released it with the following condition:
Code:
This kernel is (C) 1991 Linus Torvalds, but all or part of it may be
redistributed provided you do the following:
- Full source must be available (and free), if not with the
distribution then at least on asking for it.
- Copyright notices must be intact. (In fact, if you distribute
only parts of it you may have to add copyrights, as there aren't
(C)'s in all files.) Small partial excerpts may be copied
without bothering with copyrights.
- You may not distibute this for a fee, not even "handling"
costs.
See:
https://lkml.org/lkml/2006/9/25/161
Thereafter, he applied the General Public Licence Version 2 (GPLv2) which embodied the same conditions. The GPLv2 also came out in 1991 (see the GNU website).
As to why the kernel was made free and open source, Linus comments:
One can speculate about the motivation for his free gift of linux, and perhaps reference his many videos and writings. Nevertheless, there are a few ways of viewing the free aspect.
One could be a purely functional one. In this guise, making linux free with the following stipulation in the GPLv2, will in all likelihood produce a better functioning linux:
Another motivation for the designated "free of cost" aspect may derive from the scientific tradition. In that respect, for the non-technical questioner who is asking, a relatively obvious analogy is the way in which scientific progress is made for humanity by those scientists, researchers and investigators involved who freely publish their findings and results which are free to access in journals and other publications and thus serve and potentially benefit people the world over. Not all such developments are free or freely accessible, but so much is, and linux can be seen as part of that available tradition. Making such things free can perhaps be seen as a moral choice in favour of progress for all.
In relation to the developers and others who contribute to the kernel, they come from numerous walks of life. Some work in employment that actually provides them with time to work on linux projects, others contribute from their free time. Lots of companies sponsor individuals and teams to work on linux projects. The Linux Foundation is a source for information on these things. In the commercial world, assisting linux developers may have more of a functional motivation, but in the end result which is freely available, there is an inherently moral aspect to "the good" in relation to free sharing of progress.