In order to secure needed natural resources, Imperial Japan attempted to establish a Greater Asian Co-Prosperity Sphere with Japanese control. The U.S. Navy (and to a lesser extent, Royal Navy) were a threat to the development of this plan. The December 1941 attack on Pearl Harbor might be viewed as a logical attempt to neutralize this perceived threat.
In early 1942 many Americans believed that Japan was planning an attack on West Coast military targets such as the port facilities, military equipment and aircraft manufacturing plants of San Diego, San Francisco, Portland and Seattle.
But an attack on the continental United States would have been logistically next to impossible. An invasion force large enough to occupy West Coast cities would have required massive logistical support. A general military concept is that a small invasion force can travel long distances, but transporting and supplying a large force can only be completed with proximity to the point of attack (e.g. England to Normandy or Okinawa to Japan).
Likewise, in order to carry out simple raids raids (without landing large invasion forces) on the West Coast, Japan would have needed to occupy Pearl Harbor. But Hawaii was not invaded at the time of the Pearl Harbor attack because the Japanese lacked the logistical capability to do so, and because the USA still had substantial forces in the western Pacific.
Nevertheless, in early 1942 many West Coast citizens (and officials who should have known better) had a level of concern regarding Japanese attack that bordered on hysteria.
Read more opinion regarding the possibility of a Japanese Invasion of our West Coast USA in 1942