They were in a pretty dire situation at the time in terms of the US embargo against essential resources. They knew they were never going to win a an all out war with the US, so why provoke it?
I do think this has been addressed elsewhere but I'll throw in what I've read.
The Japanese were heavily involved with East Asia by 1941 with skirmishes and battles continuing throughout China and now into South East Asia. By this time, the US had been a little rattled with the events happening on the Asian content and they began supplying Republic of China forces while throwing embargos at Japan.
In the minds of Japanese tacticians, the Unites States was the only player in the Pacific that could successfully interfere with their plans to create the Prosperity Sphere and claim most of Asia as their own. A plan was hatched to knock out the US' main naval forces in Hawaii to more or less force the United States into recognising Japanese power in Asia. The plan in the beginning was never to have an all out war with the US. The Japanese military knew that this was a recipe for a disaster, but if they could take the US down a peg and force them to agree to Japanese demands, then the Empire could flourish with little interference.
The US however did not react in the way Japanese leaders had hoped and they were further emboldened by the fact part of the pacific fleet had not been in port when the attacks commenced. That portion of the fleet would prove pivotal to winning the war in the Asia-Pacific as well.
It is possible that, in my mind, had those ships been damaged or destroyed in the same battle, the US may well have at least accommodated for Japanese power in the short-term.
Essentially the plan was not the beat the US, but to get them to accept what Japan was doing in Asia by diminishing the ability to project power.
Chief Source: Hirohito and the Making of Modern Japan by Herbert Bix
This came up a week or two ago and got some answers:
To quote from that thread and a linked thread:
Japan was quite aware that a long war against the U.S. was not winnable. Their war aims were to secure the resources of Southeast Asia (in particular oil, but also rubber and other industrial supplies). They couldn't do that with a U.S. presence in the Philippines. So their overall war plan, which saw successive revisions throughout the decades before 1941, was to quickly defeat colonial powers in Southeast Asia, and to build a defensive perimeter that the U.S. fleet would be attrited by before a final annihilating battle, after which the U.S. would sue for peace. The idea was that the American fleet, steaming west, would have to face Japanese air power and submarine attacks before making it to the vicinity of the Philippines or the home islands, where it would be decisively beaten.
To that end, the Japanese fleet's composition emphasized quality over quantity; they trained very elite naval aviators, for example, but very few of them. They also emphasized night fighting, the use of torpedoes, and an offensive spirit that was reckless and dashing, all to overcome numerical weakness that was inevitable given the two countries' industrial bases. At the start of the war, the Japanese arguably had the finest air fleet in the world, absolutely had the largest battleships, and had unparalleled torpedo technology. In the immediate run-up to WWII, the Japanese naval leadership conceived the plan of striking the Pacific fleet in Pearl Harbor at the same time as planned strikes on US, Dutch and British possessions in the Philippines and elsewhere.
The Pearl Harbor attack was inspired partly by the British raid on Taranto, and was designed to cripple the U.S. fleet in harbor to win the Japanese extra time to build that defensive perimeter. To say that the political leadership underestimated America's resolve for a long war is an understatement.
For some reading regarding Japanese prewar plans, Peattie and Evans, Kaigun: Strategy, Tactics, and Technology in the Imperial Japanese Navy, 1887-1941 is the gold standard. It covers both operational and strategic developments in the building of the navy, and how those influenced one another. It is weak on airpower, because the two realized they were writing a long book already, but Peattie used much of their research to write the companion volume Sunburst: The Rise of Japanese Naval Air Power, 1909-1941 (Evans has passed away).
For some reading about Midway, the current best book out there is Parshall and Tully, Shattered Sword: The Untold Story of the Battle of Midway. It's The first history of Midway that draws heavily upon Japanese primary sources and dives into Japanese doctrine and tactics. Does an especially good job of telling the story from the Japanese perspective while rebutting or refuting many of the tropes about the battle and the "failings" that armchair admirals like to point out.
And from the linked thread via u/parksungjun:
The only thing I might add is that the reason Japan needed those resources was because of an Allied embargo and asset freeze as a result of Japanese actions in Indochina and China. Japan was stuck in a war in China that it absolutely needed to win (or face a military coup) and the only way it could win was with access to those supplies embargoed-an embargo which would only be lifted with a Japanese withdrawal from China.
Hope this helps!