First, a Human

I have a hierarchy of what I am. It helps me make decisions. I am first a human, then I am an engineer—a software engineer. When a situation arises where a software engineering task requires me to be unethical or compromises my humanity, I will not do it.
If you aren't mindful of what you fundamentally are, you become nothing but a tool for potential evil and chaos. You would lose yourself.
The book Obedience to Authority discusses this specifically. It documents, summarizes, and analyzes the results of the famous Milgram experiment conducted by Stanley Milgram at Yale University in the early 1960s. The experiment was set up to test how far people would go in obeying an authority figure, even when instructed to perform acts conflicting with their personal conscience.
Subjects were told they were participating in a study on memory and learning; they were cast as "teachers" who were instructed to administer increasingly severe electric shocks to a "learner" in another room whenever they made a mistake. No actual harm was inflicted—the learner was an actor and the shocks were fake—but the subjects believed they were real, with the voltage labels ranging up to "XXX" and "Lethal." Different variants were set up to simulate different levels of authority and pressure, but the core result was chillingly consistent: a majority of subjects were willing to continue until the very end, simply because they were told to do so.
Across these experiments, a significant number of subjects chose to continue the "shocks," either voluntarily or because they felt pressured by the experimenter's prods. Those who would enjoy the thrill of torturing (there were none in all of the experiments, IIRC) are psychopaths; those who feel nothing—neither remorse, sympathy, nor discomfort—are sociopaths. Being a sociopath is not a binary thing. Someone sociopathic could feel for the person being harmed, but far less than a normal person would, and whatever humanity is in them can be further diminished by various factors. Some subjects were not total sociopaths, but they were definitely higher on the sociopathic scale. The commands given to them, or perhaps the role they were given to play, had overridden their humanity.
Always remember what you are above all. A human.
