The Nazis wanted to murder anyone who wasn't blue eyed and blond. I've always wondered why Japan thought an alliance was a the way to go. Everyone should be able to see the one massive flaw in this plan of theirs.
The Japanese understood that war with the allies, particularly with the US was inevitable - the alliance was of relatively low risk to both sides due to the distance between the two theaters and splitting up American war efforts on two fronts half a world apart presented the most likely chance of Axis victory. The enemy of my enemy.....
At the time, they were rather racist themselves, to other Asians. They treated European prisoners comparatively well, as opposed to Chinese, Koreans, etc.
Also, to add to /u/idm03's thoughtful answer, Japan's "Asia For The Asians" motto was very attractive to Germany, as well as Japan, as colonial Allied powers drew much wealth and resources from the East. There was a very clear understanding, remove Japan's colonial competition in Asia and it would be a win-win for both sides.