You are correct that "The CEO's job is to allocate resources to initiatives that will make the company money" and with driverless cars and google glasses the CEO is doing exactly that.
Also people working on these projects are scientists at googleX they are completely different from the Android team ... Google has enough resources (people and money) to pursue these long term research project without hurting their short term business too much.