Were the subjects in the Stanford prison experiment randomly assigned to the study? The Stanford prison experiment tested what would happen when a group of subjects was pushed in the role of prisoner, while a second group was assigned the role of guards. Within merely a day or so, the guards started to harass the prisoners, humiliate them and made the prisoners physically and mentally suffer, forcing them to cleaning out toilet bowls with their bare hands, do push-ups, jumping jacks and what not. 

Now I am wondering - how can normal people turn so evil? Were the assigned guards tested for any existing psychological problems prior to the experiment, or were they randomly chosen? In general, how did the researchers choose the subjects?
The subjects in this experiment were randomly assigned in two groups (prisoner versus guard). They were all healthy and without any  identified psychological issues. I quote from the Setting-Up page of your linked website:


  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.
  
  More than 70 applicants answered our ad and were given diagnostic
  interviews and personality tests to eliminate candidates with
  psychological problems, medical disabilities, or a history of
  crime or drug abuse. Ultimately, we were left with a sample of 24
  college students from the U.S. and Canada who happened to be in the
  Stanford area and wanted to earn $15/day by participating in a study.
  On all dimensions that we were able to test or observe, they reacted
  normally.
  
  Our study of prison life began, then, with an average group of
  healthy, intelligent, middle-class males. These boys were
  arbitrarily divided into two groups by a flip of the coin. Half were
  randomly assigned to be guards, the other to be prisoners.


Note that people can do pretty nasty  stuff under experimental conditions. For instance, take the Milgram experiment. In this experiment, actors were placed behind a closed door. They would be faking a test subject being electrocuted up until the point of agony. The real test subjects were instructed that they would be helping in an experiment where the effect of punishment through electric shocks would be tested in a learning task. The actors had to answer questions and when they were wrong, the test subjects were instructed to deliver increasingly stronger electrical shocks by pushing a button, until the trainee would improve their performance on the task. This experiment ended up with people consciously electrocuting innocent volunteers. Although everything was faked behind the scenes, it did show that regular, healthy test subjects obediently followed the instructions of the authorative experimenter when instructed to increase the voltage and electrocute the person behind the door, even when the actor was screaming in agony and explaining having a heart rhythm disorder.