After the October Revolution of 1917, homosexuality was decriminalised in Soviet Russia with the repeal of the legal code of the Russian Empire, and this decriminalisation was confirmed with new criminal codes in 1922 and 1926. Under Joseph Stalin, the Soviet government reversed course in the late 1920s and promoted harsher policy against LGBTQ rights. In 1933, homosexuality was recriminalised in the Soviet Union, and Article 121, which prohibited male homosexuality, was added to the Soviet penal code in the following year.
You don't get to blame this on the Nazis.