Regardless are you willing to do the same? Just as millions are employed through the various agencies of the DoD through contracting it'sthe same with the large technology companies. Google, Microsoft, Amazon and many others are actively DoD contractors. So they're making money in the exact same way and yet I never hear people telling them to stop or quit .
So are you going to continue using Google, Microsoft and Amazon knowing they actively work on DoD projects and profit off of them?
If you don't happen to live in a region where the military is the sole employer, and therefore you have the option to not work for them, and you're also concerned by the conflict of their actions vs proclaimed mission, then what justification is there to work for them directly?
What it boils down to, if I were at Red Hat, and I got presented a project to work directly with and for the military, I would kindly decline. But I would still work on Fedora and/or RHEL because those aren't exclusively for the military.
You can work for an arms producer on automatic assault rifles, but then you cannot reasonably expect me to believe you're under the impression that the products you build are purely for hunting and sports. Then there are arms which you can work on that are unlikely to be used by the military and primarily for hunting/sports, and assuming hunting is for controlling wildlife population, it's understandable why it's morally acceptable.
That said, there are certainly peaceful tasks the military is responsible for, and we can make exception for those, like handling natural disasters, providing logistics for weather research, etc., but let's not kid ourselves, the military didn't grant the invention of the Internet for connecting the world population.