A few thoughts:
In the twenty years between 1992 and 2012, Republicans have won the popular vote once (2004). 1932-1952 was the last twenty-year period where the GOP won the popular vote only once (in 1952). Democrats went through a similar dry period between 1968 and 1988, only winning the popular vote in 1976.
According to exit polls, Romney lost ground in many states with working class voters, especially those making between $30,000 and $49,999. For those making under $30,000 and those making over $50,000, Romney improved on McCain's performance, but, for those in that middle range, Obama improved his performance, going from a 55-43 lead in 2008 to a 57-42 lead in 2012. Obama's gains with the working class was particularly pronounced in states like Ohio, New Hampshire, Nevada, Virginia, and Colorado. That working-class swing helped pull down Romney in many battleground states.
Independents did swing toward Romney (he won them in many battleground states) but not by enough.
Immigration-related politics cannot really be blamed for the losses in New
England, Ohio, Wisconsin, Michigan, Pennsylvania, Indiana (for the
Senate), Missouri (for the Senate), or a number of other outstanding