At a simple level: investors might want to invest in a given company at any point on the risk/return curve, rather than just the one their stock or a particular bond issue is set at. They might want to invest in a particular sector rather than having a view on specific companies. They might want to invest in a company whose stocks are priced in a different currency from their own, but without exposing themselves to the currency movements. They might believe a particular sector will outperform the market without wanting to take a view on how the overall market will perform. They might have a big chunk of a commodity to sell in six months and want to spread out the sale according to whenever gets the best price. And all of these views do, ultimately, filter down and translate into concrete capital allocation in the real world: maybe a particular sector ends up hiring more people or building more factories because they have more capital, and the economy does better for everyone when capital is spent in the best way. (Of course it's possible for everyone to be wrong, but the basic idea that averaging out everyone's buying and selling results in our best guess for where the money should go seems sound).
Of course mechanically you end up with a lot of intervening speculators - in between investor A who has a particular set of views about the market and company B that desires capital on particular terms, there might be dozens of intermediaries. But I see that as no different from the way that most real-world transactions are business-to-business - in between you buying a furniture cabinet and the people growing the wood or mining the metal there are dozens of intermediate suppliers, each with their own particular speciality, all adding a little bit of value.