My cousin wrote software for missile guidance systems around 20 years ago. I asked him once about how he felt (he was a quiet and soft-spoken guy who was a pacifist like me), he told me that he only thought about his specific job and never thought about the end usage.
My best mate from school days went into programming and his firm picked up a missile guidance contract around 20 years ago, he refused to work on that contract and the company was fine with it moving him onto other non-military projects.
Conversely, would you work for Nike or Apple, who have repeatedly avoided to look at child labour and manipulative working conditions in all their offshore manufacturing facilities? Or would you have any problem working for Chick-fil-A with their anti gay stance? You look for ethical reasons to work for employers and it's a slippery slope.
Areas like child labour, poor pay and working conditions and lower health and safety standards and environmental concerns in other countries are a minefield but it is up to everyone to try to hold companies responsible for their actions and it's easier to do that from within rather than standing on the sidelines protesting. Unfortunately once companies go global they do tend to seek the lowest cost base for new manufacturing facilities or to claim they have to work to local standards in order top win work and it's very easy from the swish head office in London or Paris to focus on the bottom line and gloss over ethical issues by making blanket corporate policy statements denouncing corruption, exploitation and danger in the workplace. I've worked for a couple of huge civil engineering multinationals and had to make judgement calls on many of these issues on a regular basis to ensure work progressed but that the company was not exposed to undue risk and that both my and the companies ethics were comfortable, in the Philippines or India the odd brown envelope being passed over by a local member of staff was sadly the norm on most major projects and so long as it wasn't a huge amount and it was being done to keep a project moving rather than as a bribe to procure work then you would generally turn a blind eye, we also had to cut almost half our staff in one office thanks to a corrupt culture that had committed large scale fraud and in one instance had to strike off one of our principal suppliers when it became apparent that he thought offering the services of prostitutes was an acceptable way of solving problems.
Health and safety was always a battle as accidents can happen but nobody should be putting their life at risk for a day's pay however in some cultures cutting corners and taking risks I would consider unacceptable are the norm. Even when accepting no compromise on safety with the backing of our head office we still suffered fatalities on 4 sites including one where 59 people died, thankfully none of them were my direct sites but the effect within the company was always immense. In many instances we'd have to sneak onto our own sites to try to root out any safety breaches, bad practices or even child labour to prevent things being covered up when they knew we were due to visit, we still knew that bad practices would go on behind our backs though and all we could do was deal with the managers involved after the fact.
I've worked on military projects where our work was purely to protect troops and civilians and worked on roads, power stations, ports and oil projects that some would see as potentially environmentally harmful but I'm happy that at least if I'm doing it I know the best standards will be followed and harm minimised. The only areas where I'd personally draw a line and refuse to work would be on military offense projects or on projects where I consider the environmental hazards and long term effect outweigh any benefits like fracking, open cast mining etc.