Prior to Operation Barbarossa, Stalin’s primary goal with regard to Nazi Germany was to postpone war long enough for the Soviets to better prepare themselves. Throughout the 1930’s Stalin openly predicted eventual war with Hitler’s Germany, but his plan to rapidly industrialize the USSR was still underway and he was keenly aware that the Soviet Union needed more time to prepare for the inevitable clash. Although Hitler’s master plan was always based around eastward expansion for Germany and the annihilation of “Judeo-Bolshevism,” he knew that Britain & France posed the most serious near-term military threat to these goals. Hitler needed his eastern flank secured long enough for his Western European enemies to be brought to heel. The Molotov-Ribbentrop Pact of 1939 thus gave both sides what they secretly wanted, masked under a veneer of genuine amity between the two would-be empires.
At no point were the Nazis and Soviets genuine partners- for both sides it was a game of postponing hostilities. The Soviet calculus was that, although war was inevitable, Hitler would only initiate hostilities after achieving certain prerequisite milestones such as neutralizing France & Britain and conquering Poland and Czechoslovakia. In fact, despite Stalin’s accurate prediction of eventual war with Hitler, one of the reasons that Barbarossa caught him by surprise was his firm belief that Hitler would not attack him while Great Britain remained in the fight.
To Stalin, impeding Hitler from achieving the necessary pre-war milestones was a means of delaying the war he knew was coming but wasn’t yet ready for. The longer Hitler was tied up in Wester and Central European affairs, the longer the USSR had to prepare for the looming war. This was in part due to Stalin’s incomplete industrialization program and his ongoing reorganization of the armed forces. The Soviet-Czechoslovak defense pact of 1935 and Soviet support of Czechoslovakia during the 1938 crisis were intended to help delay inevitable German aggression toward the USSR by hindering Hitler’s expansionism. Czechoslovakia was an important milestone for Hitler because its strong military posed a threat on Germany’s border and its large munitions industry would greatly boost the Wehrmacht’s arsenal.
Stalin was essentially trying to get as much anti-Hitler mileage out of the Czechoslovakia situation as he could. Once Hitler obtained his initial demand (annexation of the Sudetenland) at the Munich Agreement in 1938, the Czechoslovakia situation had far less value to Stalin’s delay-the-war plan and he instead turned to diplomatic courtship of the Nazis. This led to the Molotov-Ribbentrop Pact less than a year later. This made the Nazis & Soviets into “partners” but was, in fact, secretly a means for both sides to delay a war that each knew was inevitable.
tl;dr Czechoslovakia was a useful opportunity for Stalin to delay Hitler’s expansion and readiness for war against the USSR, which Stalin had long considered inevitable. Eventually, however, the prospect of an official pact with Hitler offered more value. Both the Czechoslovakia maneuvers and the pact were a means for Stalin to buy more time to industrially & military prepare for eventual war with Germany.