There has been threads about this before, here’s one: http://boards.straightdope.com/sdmb/showthread.php?t=127889
When it came to politics and world conquest strategy, the prejudices at least some German leaders no doubt had against Japanese became irrelevant. In Realpolitik, Germans were interested in controlling Europe, Mediterranean, Middle East and the areas surrounding them, while Japanese had their interests on East and South Asia, and Pacific Rim. These claims did not conflict much, so there was no rational reason why Nazi racistic beliefs of inferior races should include the Japanese, or anyone else that was considered an ally for that matter.
Besides, there was the more mystical branch of Nazi ideology that saw the Germanic race as the descendants of the mythological master race of the days of old. It seems at least Himmler pinpointed the origin of this race around India and Tibet, where they and their original pure religion supposedly had their (first?) golden age. Names and concepts like ‘Aryan’, and symbols like the swastika were thus imported from India for German use. One consequence of these moves was that the Nazi ideology as we know it did not really consider the “yellow” race as inferior so much than different (while others, like black Africans were clearly subhuman to them). World history could then be twisted for propaganda purposes to show, for example, how the Tibetan highlands were Aryan Urheimat etc. (compare to Ku Klux Klan and their views of American/European history). It didn’t take much to declare that Japanese were “Honorary Aryans” then. Some argued that Japan was actually founded by a lost tribe from Aryan homeland.
It’s interesting to see how flexible the Nazi ideology sometimes was, and how strict it became at some other occasions. Hitler admired the English, but had to fight them. He hadn’t really anything against the Romance countries either, so the alliance with Italy and cooperation with Spain is understandable, and the occupation of France was purely for strategic and political, not ideological reasons. On the other hand, Slavs were clearly lesser people to him, unfit for everything except slave labour and dying young. Still there were Slavic divisions in German armies, but at the same time Ukrainians and other former Soviet subjects who often were supportive for their war against Soviets were unwisely oppressed and thus finally turned against German occupation.
Perhaps the most bizarre is the treatment of Gypsies. They had been looked down in Christian Europe for centuries so they were natural target for a regime so brutal as fascist Germany. But it turned out that under Nazi beliefs of Aryan race, the Gypsies were actually the most pure Aryans of Europe, having migrated from Northern India as late as the Middle Ages! Therefore, instead of destroying them, they should have been honoured, but obviously this wasn’t what the political and military leaders could’ve ever tolerated. The answer, I’ve been told, was easy: Nazis decided that large majority of Gypsies (Roma people) had at some point of their history crossbred with other races and thus were not pure, making them concentration camp fodder, while a minority (mainly those of Sinti people) were declared actually pure - and, to save their purity, sent to reservations far from population centers.
Usually, as Paul also explained, it’s the simple politics of real world that cause states act against their ideology. If the Axis powers had managed to win the whole World War, they would have had so much Lebensraum that if a final match between the new world powers had came someday, it would not have been caused simply by some racist ideology.