Those clicks are essentially auctioned off so that someone is quite simply the market. The market, when it comes to online advertising, is largely benevolent. Tons of businesses are built on the fact that Google allows those to buy traffic who can benefit from it the most. The overall wealth creation of such a system is massive, far beyond the wealth created for Google.
Lots of people have jobs because a system exists that allows crappy game ads to interrupt your dinosaur article. it sucks (and the physorg site is kinda shitty for formatting it to look like a headline) but overall the system is a great thing.