Good on "Andrew" for walking away.
But people do need to understand: Just because you aren't working for Evil Corp doesn't mean you aren't working for Evil Corp. Some people get a paycheck for Evil Corp. Others contribute to work that eventually finds its way to Evil Corp.
A great example being that 10-20 years ago, the new hotness in computer science research was "big data" and "graph analytics" with EVERYONE scraping twitter and the like to prove that their algorithm was faster or to correlate data faster. Plenty of people insisted they were doing "pure research" and... I should not need to explain the uses for rapid analysis and clustering of social media data.
Because the reality is that you aren't getting money to make teddy bears (well... some people do). Because, at best, you are getting paid to make some asshole a bit richer. More likely you are getting money that has been laundered a few times but is going toward "National Security" and that is true no matter what country you are working in.
I very much spent a few years "developing the Death Star" as it were. And I don't at all regret it. It was some of the most fulfilling research of my life and it taught me a lot of useful skills and has informed my life view. But I'll also always remember what one of my mentors explained to me before putting me in for certain paperwork: Anyone with a soul turns to either activism or alcoholism. And... I am definitely a bit of column A and a bit of column B if you catch my drift.
So yeah. Follow your morals. But understand that ALL people who work in science and engineering are Chris Knight. And even if you do get your popcorn house moment... that death laser is still up there and someone else will find a way to improve on it.