Why? I am not enough of a political scientist to be sure, but recent conversations I have had with some Harvard undergrads have led me to a conjecture: It was largely noneconomic issues. These particular students told me they preferred the lower tax, more limited government, freer trade views of McCain, but they were voting for Obama on the basis of foreign policy and especially social issues like abortion. The choice of a social conservative like Palin as veep really turned them off McCain.
So what does the Republican Party need to do to get the youth vote back? If these Harvard students are typical (and perhaps they are not, as Harvard students are hardly a random sample), the party needs to scale back its social conservatism. Put simply, it needs to become a party for moderate and mainstream libertarians. The actual Libertarian Party is far too extreme in its views to attract these students. And it is too much of a strange fringe group. These students are, after all, part of the establishment. But a reformed Republican Party could, I think, win them back.
As a former Harvard undergraduate myself, I would caution Professor Mankiw against doing too much generalizing based on the political views of that institution's student body. Certainly younger voters in the aggregate are more socially liberal than their elders, especially on issues like gay marriage. But if you believe studies like this big Pew survey from 2007, they're more liberal on economic issues as well. For instance:
Gen Nexters are more pro-government than older age groups on several dimensions. They are much less likely to characterize the government as wasteful and inefficient. On balance, the general public agrees with the statement, "When something is run by the government, it is usually inefficient and wasteful" (55% agree vs. 41% disagree). A strong majority of Nexters (64%) reject this idea.
The views of the general public on this issue have shifted over time with fewer Americans now saying the federal government is inefficient and wasteful. But today's young people have a much more positive view of government in this regard than young people did a generation ago. In the late 1980s, 18-25 year-olds were evenly divided on this issue: 47% agreed that government is often inefficient and wasteful, 47% disagreed.
They're also more liberal on the environment, on immigration, government regulation of business ... really, on any issue you care to name, with two exceptions. One is Social Security: According to Pew, twentysomethings are much more likely to favor partial privatization of Social Security than older Americans (or at least they were before the bubble burst). And the other, pace Mankiw, is abortion: The report observes that "in spite of their more liberal views on other social issues, Gen Nexters do not differ from the rest of the population on the issue of abortion."