Thomas Edsall writes at The New York Times:
National polls show majorities in support of granting legal status or citizenship to undocumented immigrants. The problem for those calling for the enactment of liberal policies, however, is that immigration is a voting issue for a minority of the electorate. And among those who say immigration is their top issue, opponents outnumber supporters by nearly two to one. In this respect, immigration is similar to gun control — both mobilize opponents more than supporters.
Nolan McCarty, a political scientist at Princeton, put it this way:
Purely in terms of politics and strategy, the Democrats have played immigration badly. They have allowed their position to be associated with open borders and sanctuary cities. They have based their opposition to the immigration restrictionists in terms of identity politics rather the economic benefits of well-managed immigration. This has caused them to be deaf to concerns that many voters have about the effects of immigration on wages and public services. While I do not think the evidence shows immigration has these alleged harms, the Democrats have to do better than dismiss all opposition to immigration as racism.
McCarty specifically disputed the argument that Clinton’s lenient position was a net plus because it was crucial in mobilizing Hispanic voters.
It was probably her underperformance in mobilizing African-Americans that hurt her most, and they are generally the group least enthusiastic about open door immigration policies.
McCarty cited an October 2016 Pew poll to show that “African-Americans support for immigration is about 15 points below Democrats overall.”