The religious teachings may provide the philosophy and thought process for moral conduct and behavior.
The Nazis were driven by philosophies of nihilism and Darwinism to give substance and justification to their ideologies related to violence and cruelty.
“If we present a man with a concept of man which is not true, we may well corrupt him. When we present man as an automaton of reflexes, as a mind-machine, as a bundle of instincts, as a pawn of drives and reactions, as a mere product of instinct, heredity and environment, we feed the nihilism to which modern man is, in any case, prone.
I became acquainted with the last stage of that corruption in my second concentration camp, Auschwitz. The gas chambers of Auschwitz were the ultimate consequence of the theory that man is nothing but the product of heredity and environment; or as the Nazi liked to say, ‘of Blood and Soil.’ I am absolutely convinced that the gas chambers of Auschwitz, Treblinka, and Maidanek were ultimately prepared not in some Ministry or other in Berlin, but rather at the desks and lecture halls of nihilistic scientists and philosophers.”- Viktor Frankl
You may be a great man, but it is not reasonable to expect others to be the same as well.
There are many educated serial criminals who were capable of coherent reasoning but still went ahead with their crimes due to lack of emotional self-regulation.