The comments thus far are all correct. Hitler became Chancellor in January 1933 and the Nazi party came to power shortly thereafter. The International Olympic Committee awarded the Games (both Winter and Summer) in 1931. I don't blame the IOC for that. They could not have foreseen the rise of totalitarianism and fascism 5 years in advance.
However, I do blame the IOC in general and its President, Henri de Baillet-Latour for not moving the Olympics after the Nazis came to power. The was ample opportunity to move the Olympics. The German Olympic Committee members successfully massaged an agreement demanding German Jews have an equal chance to make the team to one that merely suggested it. Lastly, there was lots of anti-Semitic propaganda during the Winter Olympics in Garmisch-Partenkirchen, also in Germany. De Baillet-Latour demanded that such propaganda not be present for the Berlin Summer Olympics, and they weren't. That, and other promises, were good enough for him.
Avery Brundage, President of the American Olympic Committee and Amateur Athletic Union, did his best to tamp down word of Jews and others being repressed in Germany. Finally he visited Germany and happily lapped up the whitewashed scenery, which he dutifully reported. This paved the way for AOC and AAU to narrowly decide not to boycott the Berlin Summer Olympics. Had the US boycotted, other nations signaled they too would boycott. Brundage would be rewarded with his fealty to the IOC with its Presidency in 1952.
So the real question is not "why did Germany get the 1936 Olympics?" It's "why didn't Germany lose the 1936 Olympics?"