They had absolutely no way of knowing that at the time.
We in the UK did the exact same thing to Germans and Italians and encamped them on the Isle of Man. It was based on nationality, not race. The logic is perfectly sound and any nation - even now - would do the exact same thing again.
The issue with the Japanese camps was them persisting when it was clear no threat existed, especially after Midway.
If you can't make the distinction and you're solely going on hindsight, I can't help you. But I maintain that the USA would have been utterly mental not to take that action at that time, for around 3 to 6 months.
Wait.
Let me lay this out as I read it:
Your argument is:
1) Japan attacked America
2) America had to protect itself and took an understandable, if incredibly unfortunate and admittedly racist action
this is equivalent to:
1) China has wet markets
2) We should do the same thing.
But we all agree now that 2 was a really bad choice *even in the context of the time*. They had no way of knowing. Ok, but we do! We have history to use as a guide. Turns out taking racist actions to protect your nation doesn't work out in the long run and should be avoided for potential (but entirely vague) short term benefit.
And that's before we touch on human rights.