I just saw few YouTube videos about the Battle of Midway so I cannot say my knowledge is deep. However I wonder why the Japanese decided to be on the aggressive and strike? Was a defensive position more disadvantageous for them, or was that timing the best they had, despite having insufficient planes? Was producing more planes/carriers/ other supporting vessels not an option? How about a defensive position using landed airports? Very curious. How was their morale, expectations, outlook towards the war, etc.
Part I
I am going to assume that you are referring to the wider question of Japanese policy for attacking the US and other European powers, rather than specifically the Battle of Midway itself. With that in mind, I'mg going to try and adress your question in two parts. In the first, I'll discuss Japanese policy in the lead up to the commencement of hostilities against the US, UK, and their allies. In the second, I'll discuss the Japanese plan for war with the United States. I'll then try to draw it all together in the conclusion that will hopefully answer your questions more directly.
Policy
At the time of the attack on Pearl Harbor, Japanese policy was almost entirely concerned with the war in China, and the consequences of that conflict. The China war was a veritable quagmire for the Japanese, as the army demanded more resources and further escalations of the "China Incident" in multiple attempts to finally "win" the war. At the same time, the agressive nature of Japanese aims in China continued to sour relations with the United States, which was comitted to the Open Doors policy. The increasingly strain on Japanese-American relations resulted in increased American support for the Chinese Nationalists.
It's important to stress just how little control the Japanese civillian government had over the military. Via the Principle of Supreme Command, the Army insisted that it was answerable only to the Emperor and not at all to the Prime Minister. In fact, the Prime Minister and other civillian leaders were often excluded from defense planning meetings. Even within the Army itself there were issues with control of field units. The Marco Polo Bridge incident which sparked the entire war was caused not by Tokyo's direction, but by the actions of field grade officers of the Kwantung Army on the ground, with their actions retroactively endorsed and supported by military leadership and civillian government in Tokyo. Indeed, throughout the interwar period, the Imperial Japanese Army had a marked tendency to favor the Army's interests over Japan's interests.
With the China War increasing in intensity, the Japanese military was convinced that in order to defeat Chiang Kai-Shek's Nationalist government, China had to be isolated from external supply. While the Japanese already controlled nearly all the major ports, and complete naval dominance, their focus turned to land based supply routes. Around this time, Nazi Germany had begun its campaigns in Europe, and with the collapse of the Dutch and French, their colonies in Asia (the Dutch East Indies and French Indochina respectivel) appeared vulnerable. Japanese pressure on the French colonial government in Indochina secured first Japanese presence, and then later a full Japanese invasion of the territory. The occupation of Indochina led the US to enact the Export Control Act, cutting off exports of oil and--importantly--scrap metal to Japan, an act intended to starve the Japanese war machine of the resources it needed to prosecute the China conflict.
To change our area of analysis to international relations, there is little sign of interest in the Japanese civillian government for war with the United States. Rather, national leadership almost unanimously believed that war with the United States would be disastrous for Japan. Yet at the same time, negotiations with the US were proving fruitless, as each side insisted that the other accept claims that they found intolerable. The US demanded that Japan withdraw from Indochina and China proper, yet--at the same time--significant amounts of blood and treasure had been sunk into the China war, and both the army and the wider civillian population would balk if Japan did not receive due concessions. Similar negative reactions had erupted after the conclusion of the First Sino-Japanese War, where Japanese gains in the Treaty of Shimonoseki had been reduced after the Triple Intervention by Germany, Russia, and France, and the Russo-Japanese War where the Treaty of Portsmouth was widely regarded as providing insufficient gains to Japan. To give in to US demands and withdraw from China without massive concessions would thus invite either popular uprising or a coup by the Army, concessions the United States was not willing to make.
At this stage, Japan was in an almost unbeleivably poor situation. It was engaged in a seemingly endless war in China, while simultaneously being starved for resources by the American embargo. In order to bring the China war to a conclusion, Japan would either need to give in to US pressure which was considered impossible given the above, or it would need to find an alternative source of natural resources. With the victory of Nazi Germany seemingly assured, the colonial territories controlled by the European nations now occupied by German troops was apparent. Yet, to secure the sea lanes leading from the Dutch and British colonies to Japan, the American controlled Philippines had to be secured, and an attack against the Philippines meant war with the US. Furthermore, time was of the essence. With every day that passed, Japanese stockpiles of war materiel grew smaller. Too much delay and Japan would be unable to attack even if it desired. Although some attempts at diplomacy continued, the Japanese decided to go to war with the European colonial powers and the United States.