There was an interesting paper linked on HN a couple of years ago that indicated a lot of the money is disappearing from software sales. The inference was the availability of mysql depresses the revenue from MSSQL, the availability of Linux depresses the revenue from Windows and so on.
Well of course it seems that way to you, because you have defined it circularly. Open sourcing code is in no way "giving it away for no return". There is massive return on open sourcing code, from money to improvements in the code and all other manner of things.
I have the opposite perspective from you. I think that closed source code indicates you don't value you it very much. But I understand that perspectives are different and that's okay. But you have made your own leap to not valuing code very much but you should know that the truth for a lot of people is the exact opposite of what you wrote.
Money is a good proxy for value, I know the customers who paid for my software today are getting some benefit from it, they wouldn't have put their hand in their wallet otherwise. Every time I get an order I get a warm feeling that goes well beyond the financial reward.
On the other hand some of my worst and most needy "customers" have been those using open source or free tools. Their expectations are high and gratitude low.
As I said I do have some open source projects and they have received contributions, when I add it up though it hasn't paid off.
Otherwise, open source is terrible for making money. Most clients don't care, but you're giving your competition everything in exchange for nothing.
It's great for society, though.
Just my opinion, and I know a lot of people share it.
Open source is not actually giving away your code for no money, let alone no return. It's not free as in beer.
Psychology plays an important part in how markets work.
In my own experience I was trying to demonstrate that we didn't need to bastardize the codebase into a million pieces in order to give remote developers only the small part their working on; that we might as well make the code publically available
Don't forget, the vast majority of open source is paid for by companies.