The first event that led towards the fight against homosexuality in Nazi Germany was the unification of the German state in 1871 known as the Second Reich.
After the Night of the Long Knives, the Nazis amended paragraph 175 due to what they saw as loopholes in the law.