Some software developers make the world a better place. Many produce software that ultimately not that useful, and in the worst case scenario, actively harmful to society. Is the world a better place because of Apple, Amazon, or Google? Eh, you can make an argument either way. Is it a better place because of Facebook or Twitter? Unambiguously no.
To clarify a piece of what you've said, devs working on Google ad algorithms are valuable to companies who are advertising. Your point is a higher level one that what these companies are buying from Google isn't of net value to society overall, even if it is of value to them.
Google search may be useful in the present time it is used, but Google logs people’s searches and effectively spies on the most personal thoughts and ideas people have. This could prove to be dangerous to those that are considered to be outside of mainstream society, etc.