There is a common misconception that national-socialism (“Nazism”) was an ideology. In reality, it was much more than that. It was a comprehensive neo-pagan ersatz religion with its own sacred texts (e.g. Mein Kampf), dogmas, mantras, symbols (e.g. swastika), rituals (e.g. rallies), priesthood (Hitler, Goebbels, Himmler, etc.).
Obviously, this ersatz religion was essentially a totalitarian cult headed by charismatic leader (The Führer) – Adolf Hitler. The cult that had tens of millions of followers – and not just in Germany. The cult that still has lots of followers in Europe, North America and elsewhere.
Like founders of many other religions (and of just about every totalitarian cult), the Nazis created their religion for a very pragmatic reason – to satisfy a very practical need. The need for a spiritual power.