It is not exactly a secret. At the beginning of World War II, U.S. intelligence broke the Japanese code, and through Japanese telegraph traffic learned that several hundred Japanese aliens and Japanese-Americans living on the West Coast of the U.S. (and in Hawaii monitoring the 7th fleet) were functioning as spies for Imperial Japan. They monitored Naval activities and movements, shipping, and in addition had infiltrated a number of defense plants. Had they been arrested, the secret that we had broken the Japanese code would have been revealed and our intelligence compromised. (Breaking the code is one of the reasons we won the Battle of Midway).
To sum up and make it simple: hundreds of Japanese spies on our West Coast had to be stopped without revealing we had broken the Japanese code. This is why Roosevelt signed the internment order. I never ceased to be amazed at the number of people in this country who are damned to repeat history.