There was a lot of debate as to how Germany should be dealt with following World War II back in the 1940's. This planning began before the end of the World War II, though Franklin Delano Roosevelt often tried to put off making any formal decisions as to what the Allies should do once the war had been won. Of course, this would ultimately fall to the Truman administration after FDR's death.
A lot of the concern over what should be done with Germany stemmed from what led up to World War II. Following World War I , intense war reparations plummeted the Germany economy and left them with skyrocketing inflation and a weak currency. There was a lot of resentment felt from this and was one of the things that encouraged people to lean more towards fascism.
In addition to this, Germany had begun a build up of weapons and military personnel that was in direct violation of the Versailles Treaty which was signed at the end of World War I.
When looking at how to move forward with Germany at the end of World War II, the Allies sought to prevent Germany from being able to make similar build ups, and one way to do this was to divide the country up into weaker sections, rather than allowing it to remain whole. Germany was originally divided into 4 sections, one each to be occupied and overseen by one of the main victors of World War II: Britain, France, the United States, and the Soviet Union. This would help to prevent the nation as a whole from slipping back into the fascism that overtook after World War I and brought about World War II.
The economy of Germany was also of great concern following the war. Many were concerned that imposing war reparations as was done after World War I would only bring another great bought of resentment towards the other Western powers. By splitting Germany, each country occupying a section of Germany would be able to oversea the rebuilding of their economy, simplifying the process.
In addition to all of this, as the close of World War II approached, the Soviet Union and the other Allied Powers were already beginning to see tension. With disagreements as to exactly how Germany should be dealt with and how things should be settled at the end of the war, it was easier to divide Germany into sections. This way each major victor of World War II could deal with their portion of Germany as they saw fit.
Of course, it wasn't long before the Allied powers merged their portions of Germany, leaving a Western Germany controlled by Allied powers, and an Eastern Germany controlled by the Soviet Union. This would only help to ramp up division between the Soviet Union and the West and increase tensions that helped to push along the Cold War.
Further Reading:
Dobbins, James et al. After the War: Nation-Building from FDR to George W. Bush. Chapter 3. RAND Corporation, 2008.
Henig, Ruth. Versailles and After: 1919-1933. 2nd Edition. Routledge, 1995.
Hunt, Lynn et al. The Making of the West: Peoples and Cultures. 4th Edition. Vol. II. Chapter 27. Bedford/St. Martin's, 2012.