Why did Germany and Japan become western allies after WWII?

After WWII Germany was divided in in 4 different zones, occupied by the USA, the UK, France and the Sowjet Union. All of this was controlled by a central military council in (the also divided) Berlin. There were different policies which the Allies wanted to implement in Germany.

The US had a policy which was mostly about reeducation and punishment of the German people. They were not exactly decisive. They mostly waited for moves that the other powers would take. On the other hand there were influential people in Washington that wanted to unite and quickly rebuild the 3 western zones to secure western Europe against the further spread of the influence of the SU. This later became known as the Containment-Policy.

The UK was a military victor of WWII, but economically it was devastated. The British wanted Germany rebuild quickly so that they could stop aiding them and sell their goods to the Germans. Britain was once the biggest credit giver - after WWII they were heavily in debt. They also did not trust the SU, even before the Containment-Policy they had plans to politically and economically stabilise Germany.

France, well the French never really were fans of the German people (take a look at the French-German rivalry). They wanted parts of Germany to become French (particulary the Rheinland, a region in western Germany which was heavily industrialised). They also wanted Germany to be as weak as possible, basically they wanted it to be nothing but a farms. Germany should never ever be a threat to Europe anymore. So they blocked every attempt from the British and Americans to rebuild Germany till 1947/48.

The Sowjets on the other hand wanted to be the dominant power in Europe. Stalin did not think that the Americans would stay in Europe permanently (speaking of their military). He also thought that Britain and France would be permanently weakened. He basically wanted reparations for his war torn country and secure his influence over the Sowjet occupation zone. Basic reforms to transform the Sowjet occupation zone into a communist and socialist state were underway. These should be an example for how the whole of Germany should look like. A communist state under the influence of Moscow.

Later the Sowjets laid claim to the Bosporus and certain areas in northern Turkey, right after a communist uprising and takeover in Greece was prevented by the US interfering (they backed the ruling overnment). This was called Containment. A middle ground between Rollback and Appeasement. This policys aim was to prevent the spread of communism all over the world.

Germany was supposed to be rearmed and integrated in the later NATO forces to withstand a Sowjet assault on western Europe. Germany has a central position in Europe and therefore is of great strategical value. Same goes with Japan. Stalin wanted communism to also spread to Japan, but the US was obviously not going to let that happen. With China already being communist under Mao Zedong they needed a counterweight with free western, kapitalist values. Japan.

TL;DR: SU was spreading Communism -> the US wasn't a fan -> Containment -> Germany and Japan as counterweights to Sowjet influence in western Europe and Asia!

Hope I could help and I sure hope I did not make any mistakes^ Have a nice day :)

/r/AskHistorians Thread