Why did the Soviets want to help the Germans when they had just lost a war to them? Were the Soviets not resentful about the harshness of the Brest Litovsk treaty?
For one, the Soviet Union didn't lose a war to the Weimar Republic, the Russian Empire lost a war to the German Empire and the Bolsheviks signed Brest Litovsk with the defunct Kaiserreich. Neither imperial empires existed (at least in their old form) by the time of the Rapallo treaty.
Both the Weimar Republic and the Soviet Union had the status of pariah states within Europe, and can not count on cooperation from unfriendly western powers. At the same time both countries sought external economic relations but were hampered by their pariah status, thus cooperating with each other made sense. From a geopolitical point of view, both Germany and the Soviet Union shared a common enemy in Poland and wanted to slice off Polish territories which had belonged to them pre-1914.
The military provisions of the secret treaty also benefited both sides, the Soviets gained access to technical German military knowledge through those facilities.
It's funny you mentioned that!
I'm currently reading Molotov Remembers, a series of interviews Felix Chuev had with the Soviet Diplomat Vyacheslav Molotov, going over his experiences from Lenin to Stalin and beyond.
While most likely biased, Molotov claims that Stalin never exactly trusted Hitler, yet wished to secure their borders against immediate German aggression as well as bide time for a military buildup when the time came to deal with Germany.
From the Soviet perspective, there were a great deal of perks that came with cooperating with Germany-- other than buying time for themselves, of course. The Molotov-Ribbentrop Pact would expand the Soviet Territory by a large amount (letting them reclaim a great deal of Russia's traditional territory) and push the borders a bit further from their most important cities (Leningrad, Stalingrad, etc) as well as, as I said before, give them time to build themselves up.
From the German Perspective it would prevent them from fighting a two front war immediately as well as keep Poland from being able to mass all their forces against Germany on one large front.
Molotov goes into detail in the interviews, explaining that Stalin felt the Red Army wouldn't be able to stand against the Wehrmacht until at least around 1943, and that they kept to the agreement and made numerous export-import trade deals with Germany in part because they were hoping to stave off inevitable war as long as they could.
Funny enough, Molotov also said that Hitler made numerous attempts to try to convince the Soviets to go to war with England and seize India in order to obtain warm water ports, though Molotov repeatedly shot down the idea and tried to convince Hitler to abide the treaty and move German troops away from the border.
He outright says that they were trying to abide the treaty to the best of their ability, because the slightest mistake would give Hitler cause to claim he was "Forced into war"