I believe was partly the result of WWI and the reparations that germany was forced to pay. Which led to the belief that the mentioned groups were responsible a.k.a scapegoating.
Later, they were deemed enemies of the state and hence rounded up and shipped off to labor camps where they were worked to death