Back when the idea of a corporation was first formed (I do not remember the time frame) one of the requirements to complete the process of incorporation was to prove what you were going to do for the community around you.
Companies are usually improving the community in some way (that's why they make money in the first place). Grocers sell food to the community, hardware stores sell tools and supplies for making things, even the dreaded oil companies have sold the primary source of fuel for a century (and made money hand-over-fist for it). Random acts of kindness (e.g. open sourcing projects for no reason other than "We could"), while cool, are tangential to the purpose and specialty of the company.
This is how it should be - sadly both ends (doing good and making money) are not always aligned with each other. From my personal observation I would say that they are less and less aligned the bigger the company is.
I seem to remember sending the Library of Congress a cd with source code on it when I did a copyright registration.
I guess we'll see what they've done with it when the first computer program copyrights expire in around 50 years (assuming Disney doesn't buy anymore extensions).
I think the biggest issue is that software/technology isn't "trickling down" the way that many other resources do. It's proprietary, region restricted, and short-lived.