Every company I apply to is told during the interview process that I will not work on military projects, and that I would probably leave the company if they chose to take on a military contract. If you have personal moral limits and you’re upfront about them then no-one is the worse off; I’ve yet to be turned down for a job over it and, somewhat the opposite, companies seem to appreciate frankness.
I've seen that kind of thinking in the past and it's pretty popular view. I'm just not so sure about this moral aspect. Why do you think it's more moral/ethical to abstain of supporting military? Maybe you won't do this but be sure that in some other country some similarly talented people will. If you (and many others) abstain from it on similar basis you and closest people you know may be in danger of being affected…
More generally, the irony is that the U.S. military has made a far greater positive contribution to the world than Google. Under the Pax Americana, we have seen the greatest number of people rise out of abject poverty in human history. The stable, liberal world order that has been beneficial to so many people has been bankrolled by the U.S. and backed by the U.S. military.
This world where people in India and Pakistan are using Gchat Facebook to talk to each other instead of waging nuclear war against each other is not the result of Google or Facebook. It's not the result of humans evolving beyond their tendencies towards warfare. It's because the U.S. military has made entire classes of armed conflicts untenable.