Google serves ads on top of search results for the same reason that ATT sent bills for phone service: to make money. If you focus on Google's ad serving as their reason to exist, then you might as well focus on ATT as a billing company, as those are the direct ways that both make money.
And in that vein, Google and ATT (well, the old ATT) are much more alike than different. They both took existing fledgling technology and essentially re-invented it into a profoundly reliable and life changing system; in fact they all but invented a new science.
There are orders of magnitude difference in depth and impact between twisting two wires together and the physical and information science discovered and invented by ATT, and there are equally orders of magnitude difference between serving up an html page of a computer's directory and the physical and information science discovered and invented by Google.
Either one is a fine place for Ken Thompson or anyone else to work.