Something I would add is that a lot of people don't understand how fundamental military R&D is to the collective progression of knowledge and technology. Take almost any common technology that we use today (computers, gps, rockets, airplanes, cell phones, radios, the internet, etc) and you will find it came from military R&D and use in war.
Since AI and all its related parts are the new technological hotness, to put it mildly, it only makes sense that Google, one of the companies on the forefront of this technology, would work with the government/military to do research and find ways to apply it with their scope.