The Soviet Union signed a non-aggression pact with Germany because it was forced to do so to ensure its security after the refusal of England and France to create an anti-German coalition together with the USSR.
As recognised by authoritative, including Western historians, until mid-August 1939, right up to the failure of tripartite negotiations, Joseph Stalin aimed to create an anti-Hitler coalition within the USSR, France and Great Britain.
A recurring disinformation narrative revising the Molotov-Ribbentrop Pact.
The Molotov-Ribbentrop Pact (the Treaty of Non-Aggression between Germany and the Union of Soviet Socialist Republics) was signed on August 23, 1939. To the public pact of nonaggression was appended
A secret protocol was appended to the public pact of nonaggression which divided the whole of eastern Europe into German and Soviet spheres of influence. Poland, east of the line formed by the Narew, Vistula, and San rivers would fall under the Soviet sphere of influence. The protocol also assigned Lithuania, Latvia, Estonia, and Finland to the Soviet sphere of influence.
Vyacheslav Molotov, then head of the Foreign Ministry of the Soviet Union, who signed the non-aggression pact and the secret protocol to it, denied its existence until his death in 1986. In December 1989, a special commission headed by Alexander Yakovlev, followed by the USSR Congress of People's Deputies, acknowledged the existence of a secret protocol to the Treaty between the Soviet Union and Nazi Germany. Meanwhile, Moscow’s copy of the Molotov-Ribbentrop pact was published for the first time in 2019.
Contrary to the statement that there was no alternative for the Soviet Union other than to sign the Molotov-Ribbentrop pact, it was the USSR who held negotiations with Britain, France and Germany at the same time. On August 19, 1939, Stalin publicly expressed the need to push Europe to a major war that would become an overture to the "world revolution".