Money from selling Windows goes only to Microsoft, whereas Linux is widely used without paying a penny to Red Hat. Not to mention distros like CentOS which you RedHat without needing to buy it.
Don't we all? If you include my stack as part of my software, then really I only write like 1% ... I didn't write the OS, the SQL server, the http daemon, and the billion other things I'm dependent on. That's just how software works.