But from what I've read such cases aren't always consistent with what actually happened - many Nazis were indeed punished for such things.
From National Socialist Concentration Camps: Legend and Reality by Jurgen Graf:
3.4. Punishments and Mistreatment
The widespread idea that limitless arbitrary cruelty prevailed in the National Socialist concentration camps and that sadistic mistreatment was a common occurrence is simply not confirmed by surviving German wartime documentation. We are aware that regulations may exist only on paper, and we do not doubt that acts of cruelty often occurred in the camps. But that such acts in no way reflected official policy is clearly obvious from the regulations for the camp administration. In Auschwitz, every SS man had to sign a declaration reading word for word as follows:
"I am aware that only the Führer possesses life and death decision-making powers over enemies of the State. I am not permitted to injure or kill any enemy of the State (inmate). Any killing of an inmate in a concentration camp requires the personal approval of the Reichsführer SS. I am aware that I will be severely called to account for any violation of this regulation."
Kazimierz Smoleń, former Director of the Auschwitz-Museum, wrote an article on the punishment system at Auschwitz based on German documents, in which the various punishments provided for by the regulation are listed in order of severity:
Warning with threat of punishment
Temporary transfer to a punishment company
Severe arrest with withdrawal of food
Arrest in solitary confinement
Beating (25 blows).
Prior to execution of the beating punishment an examination by a physician was required. Death sentences required approval by the RSHA prior to execution.
Severe steps were occasionally taken against SS men guilty of committing crimes against inmates: two camp commandants - Karl Koch of Buchenwald and Hermann Florstedt of Majdanek - were executed by the National Socialists themselves.
 GARF, 7021-107-11, p. 130.
 Kazimierz Smoleń, "Systeme de punition infligées par la SS dans le camp de concentration d'Auschwitz", in: Contribution à l'histoire du KL-Auschwitz, Edition du Musée d'Etat à Oswiecim, w/o year, p. 67f.
 Franciszek Piper, "I metodi di assassinio diretto dei prigionieri", in: Auschwitz. Il campo nazista della morte, Edizioni del Museo Statale di Auschwitz-Birkenau, 1997, p. 137.
And from the Smith Report No. 142:
I mentioned earlier that the Germans were keeping very meticulous records of all their doings. They did not have any reason to hide their activities. When I visited Dora, one of the camps were Paul Rassinier was kept, I saw the records which contained the most minute details of all the beatings, executions and other forms of punishments that took place in the camp, so I am sure that the same meticulous records were kept in Auschwitz and Birkenau and the other camps. Every body had to be accounted for and woe to the Camp Commander who failed in his duties. How come so little is known about Judge Morgen, who was an SS Judge who went from camp to camp to make sure that wrong doing were punished - and punished they were. Two Camp Commander were hanged for mistreating Jewish prisoners. If the point was to get rid of the Jews why punish a good officer just because he was a bit too sadistic with a Jewish inmate. According to Rassinier the Kapos (Kamp Polizei) were a sadistic bunch, who were the criminals who got looked up earlier either for crimes of having been a communist.
Does anyone have any input on the subject?