During the late 1930's Heisenberg came rather close to becoming a victim of Naziism. He was not Jewish, nor was he politically active. While Heisenberg was not a Nazi party member, he was definitely a German nationalist and he probably detested Communism even more than Naziism. The thing that got Heisenberg into potential trouble was that he thought extremely highly of Einstein's work on relativity, and he mentioned this in his classes. To the Nazis, Einstein was the human incarnation of the devil himself. Einstein's values of pacifism, equality, socialism, humanism, and of course, his being Jewish, was the very antithesis of the Nazi idea of a good society.
Heisenberg had a Professorship at the University of Leipzig, but he expressed interest in moving to Munich when a position opened up at the University there. However, he was passed over, and instead another person who was a dedicated Nazi but a second rate physicist was appointed. This was not the end of his problems, however. A denunciation appeared in a Nazi newspaper accusing Heisenberg of being a "White Jew". Now basically the derogative term "Jewish Physics" was used for modern physics, especially by some Nazi scientists, like Lenard, who simply could not understand relativity or quantum uncertainty. Had they had their way, German students would have learned only classical physics. Heisenberg was saved from the possible fate of being sent to a concentration camp by the fact that his mother was a personal friend of the mother of the notorious Himmler, the head of the Gestapo (Secret Police). Himmler recognized that Heisenberg could be very useful to the Nazi state, and they made the following agreement: Heisenberg could still talk about relativity in his classes, but not mention Einstein. As for Physics in Germany, it had been severely damaged by the forced exodus of the Jewish scientists. However, the attempt to ban "Jewish Physics" ran up against some well known empirical facts, for example fast electrons are harder to accelerate than slow electrons due to the relativistic increase of the mass with energy. (Remember E = m c squared) Thus, perversely, if Jewish physics had actually been banned in Germany, it would have been extremely bad for Heisenberg and colleagues. In fact, it could well have wrecked Physics in Germany irreparably. On the other hand, this might have been good for the allies during the War. Something like this did, in fact, happen in Russia, not in Physics but in Genetics, and the field still has not recovered!
To conclude, during World War II, Heisenberg was the chief theorist of the Uranium project. The story of the Germans did not even get close to building an atomic bomb is discussed somewhat by Rhodes and others. It is clear that Heisenberg compromised himself somewhat during the war by his dealings with the Nazis. His activities during and after the War are, however, another story.