Hitler needed the oil of the Caucasus and resources of the Ukraine. The British blockade was really hurting Germany and Hitler decided he needed those resources to continue to dominate Europe and carry on with the war.
Plus, there was that lebensraum nonsense. Hitler believed the Malthusian crap and concluded he needed to expand Germany east into all of Poland and Western Russia (and eventually exterminate most of those poor Poles and Russian serfs).
Had Hitler waited until 1943 to invade Russia, Stalin probably could have finished his rebuild of the Red Army and established good defensive lines in "his" part of Poland, which he had not in 1941.
As I said, wrapping up in North Africa and taking de facto control of Middle East oil would have solved that problem, and in the long run, no oil, no British fleet. And conquest of the USSR never made any sense. I'm reminded of that line in "Butch Cassidy and the Sundance Kid", "all they got in Mexico sweat and they sell plenty of that back here."