There must be some hard data. Looking back over the last 40+ years. Were research institutions that divested from defense funding during the Vietnam era adversely impacted. Perhaps short term. But on long scales there has been more than adequate consumer and private sector demand to compensate.
Politically, the company could face a backlash in the form of antitrust scrutiny over search monopoly. Which Alphabet seems to be anticipating as historical inevitability. With the foresight even that perhaps breaking up large trusts is great for startup innovation ;)
But it raises the general question. If given the option of taking $ to do basic science. Regardless of the funding entities motives. Do you do it anyway? An argument can be made to always take the money and do the science. You don't know what the world will look like in 10 years. Drone AI used for surgical strikes today will probably be civilian transferred to AgTech and planting seeds tomorrow. And there is always the possibility of a breakthrough.
Among the many great examples are the Human Genome Project, the Manhattan Project and DARPA Grand Challenge. Terrestrial plutonium enrichment may turn out to be the key to deep space exploration, or space based defense. Early DOE-funded genetics research was specifically interested in answering the question: can we survive radiation induced mutations from the fallout of a nuclear war? And less than two decades after a Humvee from CMU completed 8 miles on its own in the California desert we will see fleets of semi-autonomous vehicles rolling out in major cities.