Serious question: should companies not participate in contracts from their country's defense department? Or is the argument that it's only US companies which shouldn't, because the US is uniquely evil?
Is there room for ethics in military research and procurement? Absolutely. An AI company might say, "We will help you choose the best targets when under time pressure, but we won't provide an oracle that lets you justify indiscriminate killing of civilians." An explosives factory might say, "We'll build precision missile warheads for you, but not white phosphorous or cluster munitions, because these kill civilians indiscriminately.". People working for companies that do defence work have a moral obligation to observe how their labour is used and refuse to give it if the results are unethical. It's no different from soldiers having a moral duty to refuse illegal orders.
To answer your question, I'd say that participating in the defence industry can be justifiable if you remain guided by ethics, and unjustifiable if you abandon them for money. e.g. If you're currently doing anything to help develop the IDF's Lavender or "Where's Daddy" programs, it's pretty hard to argue that you have a functioning moral compass.
It's also completely fine to say, "I don't want to deal with moral grey zones" and refuse to work for companies that do military work. You might make less money, but you'll almost certainly sleep easier.