Japan was rather hostile towards China, who was getting their major resource, oil, from the United States.
The U.S. didn't like Japan's hostility, so they placed an embargo on oil towards Japan.
Japan decided the East Indies would be the best place to get the resource, but they had to disable the U.S. long enough to have time to get the oil, so they planned the attack.
The goal was ultimately to disable the U.S. Fleet long enough to get the resources they needed.