In order to preserve the good terms between the USSR and Germany, the Treaty of Berlin was signed in April of 1926 so as to continue the good friendship between the the Russians and the Germans. The reason this was so important to Germany was because Germany, in the heart of Europe, needed to have treaties on both the West and the East. By signing this treaty with the USSR, the strategic fears on Germany's eastern front. With this agreement with Russia, pressure was then placed on Poland to cede to the German demands for frontier changes and opened up the possibility of a large commercial market and increased military co-operation.
Some think that this could have been double dealing on Stresemann's part because it seems rather impractical that he would be able to appease both the Capitalist West and Communist East, but in order to be a successful nation that is caught in between two worlds, Stresemann was forced to use his diplomatic skills to their utmost efficiency and thus create the Locarno Pact and this treaty.

Sources:
Layton, Geoff. Weimar and the Rise of Nazi Germany. 3rd Edition. London. Hadder, 2005.