Simple answer is that it was effectively a quid pro quo for the Soviet annexation of the parts of Eastern Poland they took after the Nazi-Soviet Non-Agggression Pact of 1939 - gaining territory in the west to make up for losing territory in the east.
It was also intended to be a way of weakening Germany in the future by removing territory with important industry and resources.
The population transfers were about several things - making room for Poles from the annexed eastern lands, punishing the Germans for the atrocities of the war, and as a very blunt means of solving the problems of minorities in Central and Eastern Europe by removing those minorities.