I tried to search if a similar question was asked already but i found only 'why Poland gets attacked continously' and 'why UK and France did not declare war on the Soviet Union since Soviet Union attacked Poland too'. I read the answers of those questions, that are helpful, but are not addressing my question.
Poland was the diplomatic turning point pre WW2, thanks to the attack to Poland, WW2 started. Now after the war was clear that Poland would have been under the Soviet sphere of influence but i do not get why the Allies just allowed Stalin to move westwards the Polish territory. Not that i'm happy that Poland grabbed more Germany or Germany lose more territory, but if i remember correctly the moving of the Polish borders westwards caused a net loss for Poland. Poland was bigger before ww2 than after.
And while, somehow, Germany had to pay for ww2 (meh), why Poland too? Apart for considering baltic states and other countries swallowed by USSR. I focus on Poland because was the starting point of ww2 and UK and France were its allies, while its seems was more or less treated as a 'exchange body' at the end of the war. So i wonder why UK and France let this happens instead of saying something like 'USSR, you could own the detached German territory or form another puppet state (like the Kalininingrad oblast) but leave Poland as it was pre ww2, even if under your sphere of influence'.
The answers to your questions all lie within the negotiations at the Yalta and Potsdam Conferences of 1945 (one held before the defeat of Germany, the other one after), in which the leaders of the United States, Great Britain, and the Soviet Union discussed the postwar reorganization of Europe.
Note that the global power structure was very different in 1945 than it was in 1939, when Germany and the Soviet Union invaded Poland. France, a defeated power, had no influence at Yalta or Potsdam; the Soviet Union, and outsider in the negotiations between Germany, France, and Britain before the war, now stood as the preeminent power in Europe; and the United States, which maintained a high level (though not total) of isolationism prior to the war now sought to project its emerging power over European affairs. The question cannot then be framed as "why did France and Britain do this in 1939, but that in 1945" without reference to these important changes that occurred over the course of the war (i.e., Britain and France, which controlled "Western" policy prior to the war, now stood as secondary to the two superpowers).
At Yalta, Franklin Roosevelt (who would die before Potsdam) sought two commitments from Stalin. First, he wanted Stalin to promise to declare war on Japan after the defeat of Germany (the atomic bomb was not yet a proven weapon, mind you). Second, and perhaps more importantly, he wanted Stalin's assurance that the Soviet Union would help to maintain the United Nations after the war. As the sizable record from the Yalta Conference makes clear (you could spend days reading over the American-published record), Stalin's primary concern at Yalta was the creation of a Soviet sphere that could provide the Soviet Union with a buffer from future Germany aggression. He wanted to keep the Polish territories that the Red Army conquered in 1939 and to legitimize a Soviet-aligned government in Poland that would effectively nullify the Polish government-in-exile operating out of London. Roosevelt and Stalin came to an agreement -- they would both yield to the other's primary demands. Keep in mind that none of the three powers wanted to breakup the alliance at this crucial phase of the war, and that the Red Army already occupied the areas of Poland that Stalin wanted.
These negotiations continued at Potsdam, although Harry Truman had replaced FDR and Clement Attlee replaced Winston Churchill (in the middle of the conference). Truman more or less continued where FDR left off, though mutual distrust between him and Stalin is clear in the record. In an important twist, Truman received news of the successful testing of the atomic bomb while at the conference, and the record shows that others found him suddenly "cocky" near the end of the conference. He intimated to Stalin that he had a new weapon at his disposal, but he would not say what it was. Stalin, however, already knew what it was, as he had spies reporting to him from within the Manhattan Project. Perhaps, then, if Truman had become president sooner, and if the atomic bomb had also been developed sooner, he would have developed his own distinct Soviet policy prior to Potsdam and would have reneged on the tacit agreement FDR, Stalin, and Churchill had regarding the new Polish borders. But he did not, and the Yalta imperatives (which the Americans had already followed prior to Potsdam under Truman, notably in halting an American march that might have liberated Prague in order to appease Soviet anger over American infiltration into the "Soviet sphere"--and not that Churchill strongly opposed the halting of the American army, as he warned Truman that the liberation of Prague might make "all the difference in the postwar situation" in Czechoslovakia and the region. Britain, however, no longer controlled Allied policy, and he was forced to watch as Truman conceded to Stalin's demands) continued through Potsdam, and Stalin got his way.
Ironically, the commitments that FDR fought for at Yalta proved fruitless. With the development of the atomic bomb, the United States did not really need the Soviet Union's help in defeating Japan, and the subsequent Cold War diluted the efficacy of the United Nations. Future analysts were very critical of FDR for this reason--he gave Stalin so much and got little in return.
In short, Britain and France bore far less influence on European policy by the end of the war. Who knows what they would have done if they had been as powerful in 1945 as they were in 1939.