Why did the Japanese go along with Hitler and go against the United States?

Answer :

The U.S. Was Trying to Stop Japan's Global Expansion

Tokyo and Washington negotiated for months leading up to the Pearl Harbor attack, without success. ... To Japan, war with the United States had become to seem inevitable, in order to defend its status as a major world power.