Strategically Yamamoto's plan was pure insanity. Why would he want to attack the Americans? He had studied in the USA and had a favorable experience during his early career visiting the USA. Had he even been successful at destroying the entire American Pacific Fleet including all the aircraft carriers and the fuel depot on Hawaii, it would still have been necessary for Tojo to invade the American West Coast.
The problem here is that you are not looking at the War in the Pacific properly.
Remember, Japan never understood the United States. Plus, they believed in Bushido, and that they were basically a "Master Race", and would get anything that they wanted. After all, were they not one of the most technologically advanced nations on the planet? With the oldest Empire in the history of the planet? Led by an Emperor who was also a diety?
To begin with, Japan never wanted to invade the US. They saw no need, and never planned for it. Their assumption was that if pressed hard the US would sue for peace, and leave the West Pacific to them, retreating to the Continent to lick their wounds. Their actual target in the early days was the British possessions primarily, and also those of the French.
As to why they attacked the US, that should be obvious when you look at the map of the region in 1941. All of the resources they needed (primarily rubber and oil) were found in the South-West Pacific. What is now Indonesia, Burma, and other islands in that reagion. And they knew that they would be forced into a war with the UK if they were to try and take them.
Now most of the UK force was in Australia, on the other side of the objective. So that is not that much of a worry, they could take them before the UK could react. But there was another country that stood in the way.
The US. From it's bases in the Philippines.
If Japan was to invade the UK territories, they would literally be sticking their necks onto a chopping block if the US was to enter the war at a later date. With the bases in the Philippines, they could quickly severl all Japanese supply lines, and more then likely cause significant damage to any supplies going to and from Japan itself. Therefore, from a strategic point of view, the US had to be eliminated as a threat before they could go after the rest of their plan.
Hence, the attack on Pearl Harbor, and the siezing of the Philippines.
The biggest problem with their assessment (and one that Admiral Yamamoto knew was wrong), was that they assumed a strong and decisive blow would cause the US to retreat and want out of the war. They miscalculated the outrage that such actions would create, and that it would become a battle to the death. This can even be seen in 1945 when they tried repeatedly to sue for peace on a
status quo ante bellium basis. And they could simply not understand why the US and other allies would not agree to those terms.
Now the Soviets did not join in to recapture lost territory, they pushed their possessions far beyond any they had ever held before. They in essence were advancing the Eastern borders of their empire, gaining huge chunks of the Asian colonies that Japan had previously held.
And ironically, surrendering to the Allies is what ultimately saved them. We allowed them to keep their Emperor (no longer divine), and stripped away the almost feudal system and replaced it with a true modern democracy. And other then the islands and territories largely stripped and either returned to it's previous owners or allowed to become independent, the US and other allies (with the exception of the USSR) returned all they had taken.