Another country does in Pearl Harbor, kills thousands of US Citizens, declares war n the US, and is universally understood to be the enemy, but citizens of that country are not the enemy. Since a country is comprised of citizens, I think a lot of people might have a problem with that.
Most citizens are civilians, i.e. non-combatants. We are edging into Geneva Convention territory here.
A kamikaze pilot in a Japanese war plane howling down on a US ship is certainly the enemy.
But what about an 80 year old fisherman from Okinawa who just wants to catch fish to sell in the local market, and live quietly with his family?
What about a teenage pacifist from Kyoto who protests about his government attacking Pearl Harbor?
What about a nurse from Tokyo who twenty years previously emigrated to the US and married a Texan rancher, but never became an official US citizen?
You can't assign guilt to these people, or declare them a threat, just because the pilot was Japanese. That's racism.
In my country there have been attacks on Muslims because people think: Terrorist attack. Terrorists were Muslims. Therefore all Muslims are terrorists. It's the same thing.
To take it to the point of absurdity: imagine a situation where a man named Mike robs a bank. The answer isn't to imprison everyone in the country whose name is Mike.