Krugman takes his point about immigration from Nolan McCarty, Keith T. Poole, and Howard Rosenthal's Polarized America. Here's how they put it:
The new immigrants are predominantly unskilled. They have contributed greatly to the economy by providing low-wage labor, especially in jobs that American citizens no longer find desirable. They also provide the domestic services that facilitate labor market participation by highly skilled people. On the other hand, immigrants have also increased inequality both directly, by occupying the lowest rungs of the economic ladder, and indirectly, though competition with citizens for low-wage jobs. Yet as noncitizens they lack the civic opportunities to secure the protections of the welfare state. Because these poor people cannot vote, there is less political support for policies that would lower inequality by redistribution.
This is just a terrific example of the distortions of analytical nationalism. If we assume a completely natural and mundane moral perspective, in which the whole set of people involved is taken into account, what we see is a huge reduction in both poverty and inequality. If the question is “What happened to the people in this scenario?”, then the answer is “The poorest became considerably wealthier, narrowing the economic gap between them and the rest.” But what actually happened seems to be completely invisible to the authors, which certainly suggests that their analytical framework leaves something to be desired.
Here's how it ought to go:
Immigration decreased inequality both directly, by sharply increasing the wages of low-skilled foreign-born workers, and indirectly, through remittance payments to low-income relatives at the immigrants' places of origin. Because of American citizens' opposition to liberalizing immigration, large potential further reductions in poverty and inequality have not been realized.
Reading allegedly social-scientific accounts of inequality by celebrated economists and political scientists, one would simply not know that nation states are not in fact giant firms with profits (“national income”) to be divvied up into shares to various constituencies. But such a huge conceptual gaffe cannot be the basis of a scientific analysis of a society, which is not a set of people sharing a citizenship, or even the set of people inside some political boundaries, but the actual international system of cooperative interaction we act within every day.