Hundreds of thousand of unpaid open source contributors would have a word about that. In fact, millions of voluntary workers in other fields, too.
You’re right that companies contribute to open source as well, and that their motivations are probably self serving. Your conclusion doesn’t hold water, though.