There were dozens of reasons for Hitler's failure.
Perhaps the largest reason was the lack of oil. It can be seen that each German attack or operation following Barbarossa was shorter and shorter, due in no small part to ever decreasing oil supplies. This shortage meant that tank divisions had less range, as well as mechanized troop transports and aircraft. A desperate need for oil forced the German hand, compelling them to attack the Southern USSR to seek the oil rich regions.
Supply lines were poor for most of the war, as it become necessary to transport supplies up to 1,000 miles. Lack of oil meant that transports were not able to travel far at a time, and in either case, massive quantities of draft animals were used.
The Soviets had vast industrial capacity, and once that capacity was turned firmly on war industry, they easily outpaced German production.
German weaponry was mostly decent quality, but production was a nightmare, and tanks and planes were not designed for mass production.
The Third Reich vastly underestimated the ability of the USSR to raise men. Let me note though, that contrary to popular ideas, the USSR did not just "throw" men at the Germans. While they made use of their reserves, they did not adopt so called "human wave" tactics like Enemy at the Gates would have you believe.
The fundamentally racist ideology of Nazism inevitably led to atrocities and abuses against Soviet civilians, which therefore meant that Germany would never be able to attract decisive numbers of Soviet civilians to help them. While there were certainly collaborators, there was no way that a decisive enough quantity would ever join. Even groups who had no love for the Russians, such as Ukrainians and Balts quickly learned that the Germans were not allies.
While Hitler did contradict his generals, his generals made many idiotic decisions. Many of them were of the opinion that if they had only taken Moscow, the Soviets would have surrendered. They commonly ignored economic and strategic targets in favor of political targets.
Germany saw early success in Russia, as well as on the Western front in part because the German army allowed more autonomy on an army, divisional, and unit level. As the Germans experienced failures in Russia, that autonomy began to be more and more restricted.
Perhaps there are more reasons, but these are among the major ones.