The Nazis and communists had a lot in common in 1930's Nazi Germany. They even made jokes about how often people switched parties...
"In some cities, the numeral strength of party-switching beefsteak Nazis was estimated to be large. Rudolf Diels (the head of the Gestapo from 1933 to 1934) reported that "70 percent" of the new SA recruits had been Communists in the city of Berlin"
Yep, many many people joined at that particular opportune moment and it has zero to do with ideological closeness. Which did angered hard liners and true believers. Through I doubt the 70% number.
(And yes communist were violent too, which would made them suitable for SA. They were not that ideologically close nor they shared demographics.).
The Nazis and their corporate backers (IG Faben, Messerschmidt, etc) did NOT like the idea of socialists being in power and gave Hitler an ultimatum which lead to the "Socialist" part of the platform being de-facto abandoned by 1934.