Is your question: why did the Germans fail to beat the Soviets (ie: Operation Barbarossa failed?) or is it why did their initial efforts in 1941 fail so that their offensive stretched into 1942, 43?
Several factors:
1. Hitler underestimated the impact of the sheer size of Russia. People have this image of the Wehrmacht as being nothing but tanks and mechanized gear. Far from it--at the time of Operation Barbarossa, the majority of the German Army was on foot. Without any opposition at all, you would be hard-pressed to walk from Poland to Moscow in one summer. As German forced pushed eastward, supply logistics became even more problematic and shortages began to constrain the German advance.
2. Weather. There was a late spring in 1941 in Russia which resulted in both a later jump-off to the invasion plus muddier roads (and thus a slower advance despite the lack of credible and organized Russian defenses initially). And then this led to the Germans being stuck in Russia in winter. By the time an early snowfall hit, the Germans were stopped by the weather and could effectively go no further.
3. Muddled strategy and Hitler's interference. Hitler diverted the main thrust from Moscow to focus on the Ukraine in the South. By the time the Southern flank had been secured and the Ukraine captured, the onset of winter had nearly begun and the capture of Moscow was close but not likely. Also related to this mindful of Napoleon's disasterous retreat from Moscow, in the winter of "41 Hitler decreed that no German troops would retreat. Unprepared for winter and often stuck in poorly defensible positions this resulted in them being buffeted by Soviet counterattacks that winter.
4. In that first year of the war, Stalin traded lives for time. He threw bodies of troops into combat with nearly suicidal decisions. This was especially true for the fights around Moscow, Brest, Kiev and Sevastopol, where some troops went into battle without weapons or ammunition.
All of these are reasons why the '41 offensive failed. Here is why beyond '41 the Germans were bled white on the Eastern Front:
--Russian military capability. After the first year of the war, the incompetent Russian Army (Stalin had purged the officer corps, equipment was undermaintained and over-rated) was tested in the fire of combat and better leaders and equipment (T-34 tank) emerged. It went from a mostly incompetent and numerically superior force to a tactically strong, often capable and in some cases better equipped force that outnumbered the Germans.
--Space. The Nazis were caught on the defensive and Russia was too big to defend against the Russian counter-offensives. A smarter German strategy would have been to concede space and withdraw hundreds of miles to more defensible lines. Instead, the Germans persisted with offensive manuevers (pushing as far east as Stalingrad) while still being forced to defend, became ignorantly fixated on capturing some terrain (Stalingrad, Lenningrad/St. Petersburg) at all costs rather than developing a coherent and sound strategy given the spatial and weather realities of fighting in Russia.
--strategic stupidity. The Germans aligned with the Japanese, Pearl Harbor happened, they ended up having to fight a war against the USA which now began shipping supplies to the Russians in earnest, the number of fronts the Germans were engaged on would soon multiply rapidly.
--underestimated the ability of the Russians to mobilize new troops. The Russians formed new armies faster than the Germans could destroy or capture them.
In the end, it was probably a fool's mission to defeat Russia. It is arguable that despite the weather and a few other elements, there was simply no way that the German Army as constituted in 1941 could defeat the Russians. The Wehrmacht covered 300 miles on 1 week to start the war but ran to the end of their supply lines. It isn't even clear that the fall of Moscow would have led to the defeat of Russia.