Because they can't have realistically expected that the United States would just suffer such an attack and let it slide, right? Japan must have known that the U.S. would be angry and want to strike back somehow. As the saying goes: people who live in glass houses should not throw stones. So did Japan at least put up its defenses in any way following the attack, fearing reprisal?
Yes, Japan knew that the US would strike back at some point for the attacks. In fact, their buildup of their fleet in the interwar years was aimed directly at countering the U.S. fleet., and heavily influenced by Mahanian theories and Japan's defeat of Russia in the Russo-Japanese War.
Because Japan couldn't hope to match the U.S. in terms of its industrial capacity, Japanese fleet strategy centered around the idea of "quality over quantity" and an almost obsessive fascination with the offense. This led to things such as the design of Japanese airplanes -- fast, far ranging, but lacking protection for pilots, self-sealing fuel tanks, etc. -- and their destroyer and cruiser fleets, both being equipped with long-range torpedoes. The Japanese fleet also trained heavily for night-fighting as another way to offset a numerical disadvantage, and finally built the superbattleships Yamato and Musashi as perhaps the ultimate expression of the offensive ideal.
The basic idea for Japanese strategists had been to capture the Philippines at the outset of a war, thus forcing the U.S. fleet to fight its way through a defensive perimeter of islands, with submarines, the air fleet, and night attacks from destroyers and cruisers attriting it before a final battle of annihilation somewhere near the Philippines, forcing the US to sue for peace. The attack on Pearl Harbor was seen as an extension of that strategy, giving the Japanese fleet time to seize oil- and resource-rich areas in Southeast Asia and build a defensive perimeter.
I've written more about this here:
and here:
I would also recommend this great answer from /u/parksungjun which is linked in one of the above threads: