Though this was presaged by two major prior incidents of ethnic cleansing that accompanied the end of the Ottoman Empire.
The first was of course the Armenian genocide. The second was the expulsion of Greeks from Anatolia during and the after the Greco-Turkish war, which occurred in the early 1920s. The Greek expulsions were also accompanied by expulsions of Muslims from Greece, though the bulk of the of cleansed (about 1.5 million) were Anatolian Greeks. These were people whose roots went back to classical times and before. Interestingly, this process was also endorsed by the international community at the Lausanne Conference in 1924, though by that time, most of the expulsions had already taken place.
You had all sorts of borders move around after WWI. But, with some exceptions, the people pretty much stayed where they were. Minority issues caused all sorts of problems in the interwar years, notably the status of German minorities in places like Poland and Czechoslovakia, though virtually every state in Central/Eastern Europe had serious minority issues (Ukrainians in Poland, Hungarians in Romania, etc.).
The status of German minorities abroad was a major aspect of Hitler's grand plans and one of the reasons he launched the war. This, combined with anger at the Germans for their aggression and horrendous occupation regimes, contributed to the consensus for expulsion. Not only were Germans being punished for the war, but they were also being moved to prevent future conflict.
But another major reason for it was actually the Nazi-Soviet pact. Stalin had never wavered from his position that after the Germans were defeated, the Soviet Union would return to 1941 borders (including the Baltic states, Eastern Poland, and a couple smaller regions seized from Romania). Stalin insisted that the Soviets would get to keep what they had taken in collusion with Hitler. With a large chunk of interwar Poland now belonging to the Soviet Union, the Poles were to be compensated with German territory. This was one of the reasons the number of expelled was so high, since much of the territory that was cleansed had already been German before the war (and Prussian since the middle ages).
Here are some more works on this for those who are interested:
http://www.amazon.com/Crossing-Aegean-Appraisal-Compulsory-Population/dp/1571815627/ref=sr_1_1?ie=UTF8&qid=1340002397&sr=8-1&keywords=CROSSING+THE+AEGEAN
http://www.amazon.com/Terrible-Revenge-Cleansing-European-Germans/dp/0312121598
http://www.amazon.com/Clean-Sweep-Cleansing-1945-1960-Rochester/dp/1580462383/ref=sr_1_1?s=books&ie=UTF8&qid=1340002473&sr=1-1&keywords=A+CLEAN+SWEEP%3F+POLAND
http://www.amazon.com/Redrawing-Nations-Cleansing-East-Central-1944-1948/dp/0742510948/ref=sr_1_1?s=books&ie=UTF8&qid=1340002499&sr=1-1&keywords=REDRAWING+NATIONS
http://www.amazon.com/Fires-Hatred-Ethnic-Cleansing-Twentieth-Century/dp/0674009940/ref=sr_1_1?s=books&ie=UTF8&qid=1340002515&sr=1-1&keywords=Fires+of+Hatred