Developers have great power. And they must use this power responsibly.
And if someone asks you to build something that is clearly illegal — or downright evil — go to the press. The developers in all three of these cases could have done this and saved the world a lot of heart ache.
Remember: only YOU can prevent evil code.