Its one thing is the project is illegal, but is the project immoral is a much tougher question. And I would submit that perhaps that morality is a double-edged sword.
The first question is who is defining the morality of the project, and what standard are they using for that judgment. Suppose that you're the manager and you feel that it is morally right to do this project, but one of your subordinates refuses to participate for his or her own moral reasons, which happen to be different than yours. As the manager, what is your response?
Does the company have a moral obligation, or a fiduciary responsibility to the stockholders?
Do you not have a moral obligation to take care of your family? Given the current status of the IT job market today, the risk of not being able to find another job may be quite high, depending on where you live, so you're faced with a real dilemma, that being your moral obligation to your self and to your family, as opposed to your moral obligation to your political position. Not to mention a moral obligation to your community and to your country.
And it’s quite possible that these various moral obligations are at odds with each other.
I'm not sure there is a right or wrong answer. It depends on your priorities and your personal ethos.
You can also carry to an extreme. Any technology that is or can be developed can be both used and abused. And those who abuse it today may be good users tomorrow, and vice versa.
Take Radar software - the flying safety of the general public depends on it, and it has obvious military applications for early warning of the homeland protection, and as a targeting system as well.
The artillery trainers that you spoke of, could they not also be used to train members of the British Armed Forces?, or any other military force? Does that mean that your moral participation is not based on the technology, but rather on the sales and marketing goals? Do you know those goals? If you don't, how far would you go to determine what those plans are so that you can rightly assess your own moral position? Would you spy on the sales/marketing emails to insure that you're being asked to work on a legitimate project? If you choose not to investigate, then one day you may wake up and realize that maybe you could've prevented it from happening had you done some digging. On the flip side, you can be comforted that you respected the privacy of the sales and marketing individuals. Which is better?
Is it morally right or wrong to develop software that has the potential to bring good to many people, even though if it’s in the wrong hand can be abused for harm?
The only thing I'm sure of is that in most cases, no two situations are alike and no two people will feel the same and it’s quite likely that no one will be wrong, and will be able to support their position.
Trust your instincts, and let your conscience be your guide. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein