We all have a subconscious need to "fit in". So if the situation asks for a subtle change to "fit in", we often do. If the situation keeps changing, we tend to follow. This is what can turn "good" people into "bad" people and vice versa.
For more details, see the Stanford Prison Experiment or the Milgram experiments. In both, normal, mentally healthy people are subject to the influence of a situation which gradually turns them from "good" to bad". The book Lucifer Effect explains several experiments which show how the situation can manipulate normal people into committing abhorrent tasks and how you can notice and defend yourself against such subtle influence.