https://www.wikiwand.com/en/Nazi_Party#/Etymology
The National Socialist German Workers' Party (German: About this sound Nationalsozialistische Deutsche Arbeiterpartei (abbreviated NSDAP), commonly referred to in English as the Nazi Party, was a far-right political party in Germany that was active between 1920 and 1945 and practised the ideology of Nazism. Its precursor, the German Workers' Party (Deutsche Arbeiterpartei; DAP), existed from 1919 to 1920.
The Nazi Party emerged from the German nationalist, racist and populist Freikorps paramilitary culture, which fought against the communist uprisings in post-World War I Germany. The party was created as a means to draw workers away from communism and into völkisch nationalism. Initially, Nazi political strategy focused on anti-big business, anti-bourgeois and anti-capitalist rhetoric, although such aspects were later downplayed in order to gain the support of industrial entities and in the 1930s the party's focus shifted to anti-Semitic and anti-Marxist themes.
Pseudo-scientific racism theories were central to Nazism. The Nazis propagated the idea of a "people's community" (Volksgemeinschaft). Their aim was to unite "racially desirable" Germans as national comrades, while excluding those deemed either to be political dissidents, physically or intellectually inferior, or of a foreign race.
This article gives you a huge amount of information regarding the propaganda that went on behind the name 'socialist'. Why it wasn't socialist and why it was fascist.