The (archived) official website of the Stanford Prison Experiment describes the experiment goal as follows:
We wanted to see what the psychological effects were of becoming a prisoner or prison guard. To do this, we decided to set up a simulated prison and then carefully note the effects of this institution on the behavior of all those within its walls.
A 1997 article from the Stanford News Service described experiment goals in a more detailed way:
Zimbardo's primary reason for conducting the experiment was to focus on the power of roles, rules, symbols, group identity and situational validation of behavior that generally would repulse ordinary individuals. "I had been conducting research for some years on deindividuation, vandalism and dehumanization that illustrated the ease with which ordinary people could be led to engage in anti-social acts by putting them in situations where they felt anonymous, or they could perceive of others in ways that made them less than human, as enemies or objects," Zimbardo told the Toronto symposium in the summer of 1996.