It's not at all obvious. Politicians, philosophers, ethicists, religious leaders, and military officers have ceaselessly debated this issue since the dawn of civilization and there is still no clear consensus.
If the military wants to use technology to enhance their killing techniques, then they should do it themselves with in-house development.
If they can't that's just too bad.
If we're going to have a military at all then our warfighters deserve the best killing technology we can provide to help keep the enemy from killing them. While the military does do some research in house, since we live in a capitalist society much of the work will always have to be done by private contractors.
Like biological and chemical weapons? Or more like Napalm buring through children? Or metal-free landmines that are even harder to remove after war?