Recent history continually shows that advances in military technology causes improvements in combatant/non-combatant casualty ratio. The smarter the bombs and missiles are, the less civilians they kill. Also, operators who only risk drones and not their own lives aren't nearly as trigger happy as pilots. And finally, a conflict between two countries is always more prolonged and bloody when the gap between their technological development and military prowess is smaller. Not to mention that MAD doctrine have prevented cold war from going hot.
So yes, working on all these technologies helps you mention helps humanity and saves lives.
Why are you assuming people's positions on those topics? I've seen people bring them up.
Also, unlike doctors, who are explicitly trusted with human health, programmers are not in any way different from anybody else and it's silly to try to impose a special moral code on them.
There's an argument to be made that modern weapons help keep the peace, exactly like MAD did between the USSR and USA.