Religion played a large role in World War II. Hitler wanted to create an Aryan society based only on the "Volk," people he believed were the true Germans. This excluded the Jews, who both in terms of "race" (according to the Nazis) and religion, were not German, and were in fact a disease infecting and weakening the German state. He, therefore, eventually, diverted many resources to eradicating them, thinking this would help him win World War II.
This strategy clearly did not work, though it led to a massive genocide. It helped stiffen Allied resolve against him as news of this persecution (even if people did not have the entire story) leaked out.
Hitler also wanted to radically reform Christianity and turn it into its opposite as part of his pursuit of world conquest. He found virtues that were key to traditional Christianity, such as mercy and forgiveness, to be traits that would weaken the German Volk. He wanted to replace the Bible with his autobiography and political treatise, Mein Kampf, and the cross with the sword in churches as he sought to forge a ruthless German empire. This lead theologians such as Dietrich Bonhoeffer to oppose him within Germany, sadly concluding the German state had to be be defeated to save civilized norms in the world. While Hitler had to move very carefully and never realized his vision of a warrior church, his ruthlessness about religion did help to undermine him to an extent with Germans as the war unravelled.