Before attempting the D-Day landings the Allies had conducted large scale amphibious landings in North Africa, Sicily, and Italy. They had purpose built landing craft, special undersea pipelines that could be rapidly put into place after the landings to provide fuel for the drive inland, and the Mulberry Harbors which could be set up on the landing beaches in order to allow cargo ships to unload the thousands of tons of supplies needed to support the invasion force as it moved to capture 'real' harbor facilities. It also goes without saying that they had nearly complete control of the sea and sky around the landing sites. A cross channel invasion was a huge deal that took two major world powers years to prepare for.
In contrast Germany's plans to invade Great Britain had been sketched over the course of a couple weeks. They had no landing craft and instead intended to tow river barges filled with soldiers across the rough waters of the channel. This would have been dangerous even without considering the British Navy which they had no realistic way to stop. They had nothing like the Mulberry Harbors and so would have to go right into the teeth of the British defenses in order to capture a port right away. Even if they'd been able to gain control of the skies it quickly became apparent that any attempt to invade Great Britain in 1940 would have been a fiasco and so plans were put on indefinite hold.
Eastern Europe's farmland and natural resources were the main prize for Hitler and the USSR was both ideologically and strategically his main enemy. The Soviets had a tremendous advantage in terms of manpower and manufacturing capability but the purges of the Red Army had created a qualitative deficiency that could potentially be exploited if the Germans acted quickly. Any time spent trying to knock Britain out of the war was time the Soviets had to rebuild their military which would nullify the one real advantage the Germans had on the eastern front.
German plans for the invasion of the Soviet Union predicted that the war would be over in four months. If they had been able to rapidly overrun the USSR in the same way they'd taken Poland and France then Britain would either bow out of the war or face the full might of the German military backed by the resources of their newly created empire. If they couldn't knock the Soviets out of the war by the time the Western Allies could really do all that much directly to Germany the war was likely already lost.
Attacking the USSR while they were at their weakest and Britain was temporarily weakened if not totally neutralized made fairly good sense within the context of Hitler's goals and the constraints he faced.
Its important to note that Hitler and his circle very much viewed the conflict through ideological lenses. Hitler saw Germany's defeat in WWI as being the work of socialists and leftists undermining the ever victorious German Army from within, and being controlled by the Jews that controlled the financial world. He saw the international communist movement as a tool of Jews as well to undermine European culture and that the antagonism of communism and finance capitalism as the means that the international cabal of Jews were using to ultimately dominate the world. This view had no grounding in reality, obviously, but this was the worldview of the ideological leaders of the National Socialist movement.
Hitler's political goals were first to unite all the German peoples under one Reich, then to turn back the Versailles Treaty (either through armed conflict or diplomatic demands), then the twin goal of destroying Soviet Communism and establishing lebensraum in the east. He viewed the UK as a natural ally in this endeavor as the UK historically had not concerned themselves with European territory, and had been highly antagonistic with the Soviet Union (missing the historic and obvious British strategy of not allowing any power to control an hegemony of territory on Continental Europe - a telling misunderstanding of British strategic thinking).
By the end of 1940 Hitler had achieved dizzying success for all save the final goal of eliminating communism and conquering his lebensraum. However, his total misjudgment of British thinking had left him totally unprepared for a strategic war the German military was not built for. Germany lacked serious strategic weapons (long range bombers, a navy worthy of the name, transport ships, etc.) necessary to prosecute a war with Britain. Germany was forced to rely on U boats and a tactical air force to prick the UK to death. Despite the show of preparations for an amphibious attack on the British Isles, few military planners harbored illusions about the feasibility of such an endeavor.
So Germany found herself with a huge continental army and an enemy they couldn't get to. One calculation the German leadership got correct was that Germany was in a deceptively weak position: the longer the war went, the more powerful the combined economic strength of her actual and potential enemies became. Keeping their army sitting still was out of the question. The obvious target of National Socialisms greatest ideological for, the Soviet Union, came sharply into focus. Riding the hubris of defeating what was thought to be the premier European military force of France, the Germans banked on achieving the twin goal of destroying communism and conquering the east while also eliminating Great Britain's only remaining potential continental ally - thus forcing her to sue for peace.
Operation Barbarossa was a colossal gamble that failed in spectacular fashion. It was the result of hubris and ideological goals supplanting realpolitik and realistic military calculus. However, Germany was incapable of defeating Great Britain without a long drawn out strategic war where the edge was on Britain's side as she already possessed the means of strategic warfare, and Germany would need to developed and field almost everything on the fly - a daunting prospect. During this campaign, Germany would also find her vaunted army marking time indefinitely while Stalin was allowed to complete the belated reorganization of the Red Army following the purges. The prospect of American intervention should Germany legitimately threaten to defeat Britain was also a distinct possibility - though one somewhat realistically disregarded by the German high command, since it would take years for America to field and equip an army fit to bring an attack on Germany on Continental Europe following the commencement of formal hostilities between those powers.
When it appeared that the third Reich was at the height of her power, in reality Germany was at a crossroads strategically with either prosecuting an open ended conflict for which she was ill suited, or a seductive gamble for a quick and total victory both militarily and ideologically. Even though history shows how disastrously the attack on the USSR wound up being, it is not a great leap of judgement to see why the political leadership favored this course of action over the alternatives.