On 6 June 1944, American soldiers stormed the beaches of France, beginning a campaign that would roll back Nazi Germany’s control of Western Europe. It was an unprecedented display of military might and organizational prowess for the US. The man who led that heroic effort was himself of German descent—general and future president, Dwight D. Eisenhower. Eisenhower’s family, which changed the spelling of the name from Eisenhauer (meaning “iron miner"), was originally from an area called Nassau-Saarbrücken—ironically, one of the territories the general would go on to liberate.

Had the US been the same country in 1944 that it was in 1917, there might not have been an American of German extraction leading the charge. As the US prepared to fight Germany in World War I, anti-German sentiment swept the nation. Schools stopped teaching German, German-Americans were harassed and fired from their jobs, and 6,000 Germans and German-Americans were sent to mass internment camps. It seems inconceivable that a general of German descent would have been allowed to lead the US military against his family’s ancestral homeland in 1917. And yet a mere 27 years later, that impossibility had become reality.

This anecdote illustrates a central principle of American history. When the US embraces people of all races and ethnicities, it’s not just fair and just—it’s efficient. Xenophobia deprives the country of the talent it needs to succeed. Given the chance, immigrants from any country in the world will become patriotic Americans—as will their descendants.

Unfortunately, many in the US have never embraced this lesson. For a while, it looked as though much of the country had put xenophobia behind it, especially with the formal apology and reparations for the internment of Japanese-Americans during World War II. Recently, though, irrational fear of foreigners seems to be creeping back into American policy. The arrest and detention of American citizens, mostly of Hispanic descent, by Immigration and Customs Enforcement (ICE) is not just an injustice, but an ominous sign for the US.

Now, the administration of President Donald Trump has announced plans to restrict Chinese students’ ability to study in the US. The visas of Chinese graduate students working in robotics, aviation and high-tech manufacturing will be limited to just one year, and visa clearances will become more difficult to obtain.

The ostensible purpose of these restrictions is to prevent Chinese industrial espionage. China steals vast amounts of intellectual property from American companies, depriving those companies of their competitive edge and resulting in fewer jobs and lower wages in the US. It’s a serious problem, and represents one weakness that open societies face when competing with closed, centrally managed nations.

But keeping out Chinese students is the wrong way to deal with the problem. As my Bloomberg Opinion colleague Adam Minter writes, high-skilled Chinese immigrants are an important driver of American prosperity. In the past decade, the number of Chinese students in the US has increased.

These students pay high rates of tuition that help subsidize the educations of native-born Americans. They are also amazingly productive researchers, generating scientific output as much as 30% higher than other students. And the vast majority of these brilliant individuals tend to stay in the US after graduation, working to boost American prosperity and contributing to the talent of the domestic workforce. Trump’s crackdown on Chinese students should be seen as part of a broader—and highly counterproductive—attempt to restrict high-skilled immigration to the US.

But beyond the material benefits that the US derives from Chinese students and workers, letting them in upholds the nation’s basic ideals. China is an incredibly repressive society, and becoming more so every day. The country is trying to implement universal surveillance, and recently experimented with a “social credit" system right out of a dystopian science-fiction show, denying people train and plane rides and even slower internet speed if they get flagged for bad behaviour.

That kind of oppression is what the US, at least in theory, was created to oppose. Escaping it, and enjoying more personal freedom in general, is probably a big reason Chinese people are sending their children abroad. To deny that hope of escape and freedom wouldn’t just shoot the country in the foot economically—it would diminish the US’ reputation as a beacon of freedom and opportunity.

Instead of keeping out Chinese students and workers, the US should be recruiting more, and making every effort to keep them here permanently. Intellectual property theft is a problem, but the US should attack it by putting pressure directly on the Chinese government, not on the people trying to escape that government. If Trump succeeds in closing the gates, he risks preventing the existence of many future generations of patriotic, brilliant Chinese-Americans—a whole legion of future Eisenhowers.

Espionage is an advantage of closed societies, but immigration is an even bigger advantage of open ones. In the long run, taking people will prove more powerful than taking ideas. Bloomberg View

Noah Smith is a Bloomberg View columnist.

Comments are welcome at theirview@livemint.com