Why don't we ever blame all the Muslims for 9/11?

Why don't we ever blame the whole of Africa for what the Egyptians did to the Hebrews?

Why don't we blame the whole of Japan for what they did at pearl harbor?

If it's racist to blame a whole race for what a few did then why do we constantly blame white people for what a few of their ancestors did?