If the United States naval base at Pearl Harbor could be destroyed, Japan would gain a crucial advantage in its quest to control the Pacific. However, before the strike was authorized, the Japanese admirals and other war strategists discussed the pros and cons of the surprise attack. One of the officers, I think Hashimoto, was the one who cautioned that the attack could backfire because it would awaken "the sleeping tiger", meaning that the US would be as hard to deal with as a tiger awakened from its sleep.
Having been convinced that cooperation with the United States in the South Pacific was impossible, after the scrap metal and especially oil embargoes, Japan recognized that the only way to expand its influence in the region was through conflict with the United States. They hoped to destroy the US surface fleet, in particular the all-important aircraft carriers which were based at Pearl Harbor, and the only way to accomplish this was through an all-out attack. It was the great fortune of the US Navy that its aircraft carriers were out of port when the attack took place, and were therefore not destroyed.
I'm curious as to whether your question is Why bomb the US or why bomb Pearl Harbor in particular?
The generic answer is to bring the U.S. into the war, retaliate for US scrap metal policies and to gain control of the Pacific theatre, while crippling the US navy.
Pearl Harbor specifically seems a wise choice, but not the only choice. To this day, the damage at Pearl Harbor, on our own shores, in an area we consider a paradise has a crippling psychological affect. Of course that is in hindsight, would be interesting to know if psychological factors were considered at the time or just military tactical strategy.
The Japanese bombing of Pearl Harbor brought the United States into the war. The Japanese surely knew that this was going to happen. They were fully prepared to fight against the United States directly, as well as our other allies.
What none of the previous posts has mentioned is the fact that the US cut off the supply of oil and scrap iron to Japan. Japan needed these because it did not have many resources of its own. Japan calculated that it only had enough oil for a couple years and so it decided it had to fight immediately to be able to take an empire and get an oil supply of its own (from Indonesia).
The Japanese also felt that striking a comfortable navy base was an opportunity to grab with so many American soldiers in the European theatre. Thus, Japan perceived a vulnerability in the United States and took advantage of it. Interestingly, Japanese rulers considered invading the continent at the Gulf of Mexico and coming up the Mississippi, but were concerned about coming through the South which is known to be so well armed!
The previous post covered most of the bases. The Japanese hoped to control the entire Pacific Ocean and by eliminating the U. S. fleet, their plans to capture Australia and New Guinea (and the other islands in the area) seemed a greater possibility. They did not realize, however, the resolve of the U. S. government and its citizens or the speed in which American shipyards would replace the destroyed vessels.
The Japanese saw the bombing of Pearl Harbor as a preemptive strike designed to prevent the U. S. from being successful in any potential war between the two powers. The Japanese hoped that by crippling the American fleet while it was still in port, they could eliminate what they perceived as a major threat. Of course, Japan at this time had an imperialistic government determined to expand the Japanese empire in the far east.
A consensus had been reached from a series of imperial conferences that Japan would need to fight the US to obtain victory in Southeast Asia. To prevail in a protracted conflict, Japane needed high levels of raw materials and the only way to obtain the resources from Southeast Asia was to provoke the US into a war through a surprise attack. The attack on the US would give the Japanese the time they needed to attain the resources they required and to further expand its own industrial capability. It was thus necessary for the Japanese navy to first destroy the American Pacific fleet and challenge US naval supremacy since it was the only potent force that could halt the Japanese advance in the region. By destroying the battle fleets that were located at Pearl Harbour, Japan would be able to gain the time they needed to erect a giant barrier around Southeast Asia, which when guarded by the imperial navy, could keep the US at bay. A knockout blow at sea was also essential to gain the psychological ascendancy they needed to drag out the war so as to force the Americans out of it - they were sure that the Americans would not be invested into fighting a protracted conflict in a region that they would not familiar with.