Open source projects get funded because the companies and individuals involved believe that it is in their best interests. For some, it is a matter of building reputation so that they can sell services in other contexts. Some companies fund the Eclipse Foundation in exchange for goodwill, business opportunities, advertising, and whatnot.
Pragmatically, creating and running an open source project is a good way of bring like-minded individuals together to share a development burden. Much of what is created at Eclipse, for example, is infrastructure and frameworks upon which applications can be be built. If you think about it, most of the software we use contains tonnes of functionality that you only really care about if it isn't there. You probably don't use Eclipse because of the fantastic component model (OSGi referenced implementation), or the ability to stack views, manage editors, workbench, etc. However, if all those things weren't there, you probably wouldn't use Eclipse. In general, it's probably the case that upwards of 80% of the functionality in any given application just isn't all that interesting unless it's not there. Some 80% of functionality is "plumbing". So instead of having a dozen separate organizations each spend time and money building infrastructure/plumbing that the end user only cares about if it isn't there, these companies come together in open source to work together on those shared bits of infrastructure that they ultimately use to compete against each other in the marketplace. They do it in open source so as to invite additional like-minded organizations to participate.
Other organizations get involved with open source to help develop a market. If you think of all the millions of people who just use Eclipse. If some small number of them choose to buy a useful plug-in or two, that can turn into a good business.
Some organizations bet their business on the technology. Eclipse RCP, for example, is used by--literally--hundreds of organizations to deliver applications. If an organization depends so much on a technology, it makes sense to invest time, energy, and money in it to make sure that it continues to exist and grow.
Here's an article that I found interesting:
http://news.cnet.com/8301-13505%5F3-10387512-16.html?tag=mncol;title
There are other reasons, but these are some of my favourite.