The distinction between racism and nationalism matters. You can ultimately never completely quell racism. Racists emerge out of the woodwork any time they think they can find solidarity. It's evil, and evil is fought through awareness.
Nationalism however is the fundamental basis behind modern sovereignty. It's an identity based on shared geography rather than appearances. Nationalism ultimately prevents the people in the nation from getting conquered by other nations. You don't want the sentiments running away on you, but a certain amount of national pride is good for a people.
Nazism hid racism behind nationalism, in order to meld the two political forces together to form a ruling coalition. This was fundamental to its success. You cannot merely say the Nazis were racist, to turn them into the bogeyman, without acknowledging that the rest of the world had a role to play in bringing them to power.
The West, collectively, brought about World War 2. We didn't listen to the lessons learned over a thousand years of grappling with warfare on the continent, we did not do what was needed at the end of World War 1. It was so obvious that Germany was going to rearm and try again that France immediately went to considerable expense to fortify their eastern border.
We left an enormous power vacuum in Germany in the name of greed. We would not make that same mistake again at the end of WW2, though honestly the spectre of nuclear war had a lot more to do with it than moral imperative.