The fact remains that the people on the other end of this weapon are still people, and all weapons of this kind are still a deadweight loss, economically speaking.
Think about it in these terms: you have a pile of money and a bunch of smart people. You can invest in a) creating a new technology that will make human lives better and trade with other people to increase global wealth or b) creating a new technology that will kill the people you would have traded with in the other scenario.
It is possible to both recognize that a certain amount of killing people is likely necessary in this crazy mixed up world of ours, and still be saddened by the waste and stupidity that that necessity represents. It is a huge error in economic thinking to forget that killing people is necessarily the result of waste and stupidity, either on their part or ours.
Personally, I won't work on anything whose primary purpose is killing people (and I've turned down jobs and contracts because of that) and I'm always a little saddened when I see good engineers investing their lives in such a profoundly unproductive activity.