What can cognitive psychology tell us about the results of the Stanford Prison Experiment?
I've always thought of Stanford Prison Experiment (and Abu Ghraib) as a situation in which group think forms a sort of feedback loop. If you agree that people behave within context of a group, and the context is created by the group itself (Hogg, 1998), then you can see what is happening. The context may at first be in line with the larger group (the University, or Military, or American culture in general). Within the smaller group however, individuals may "push the limit" of acceptable behavior. But in doing so, they are changing to context of the group. For a person to "push the limit" again, would be to act in an even more extreme way. The situation feeds back upon itself.

The question remains, as you pointed out, what motivation starts this movement in the first place? There is no reason to think it couldn't feedback upon itself in the other direction, either. There is some underlying feeling that is amplified by this group think. In the Hogg article, the researches essentially seeded that motivation experimentally. But in a normal situation, it can be virtually anything. Intuitively, I would say in the prison experiment the initial seed was just a desire for the students to act out the roles they were given. Prisoners obey the guards. Each time the limit of acceptable behavior was pushed, the context that defined acceptable behavior was changed too. 

Myers (1977) describes something similar, which he calls polarization. In his research, he showed a tendency for people to not only conform to the group standards, but also try to exceed them in, "the socially preferred direction". This phenomena, plus a tendency to act within the context of a group, can lead to runaway behavior.

References

http://psycnet.apa.org/journals/gdn/2/1/48/

http://www.sciencedirect.com/science/article/pii/0022103178900495