He sold himself as a moderate, at a time when Republicans were extremely unpopular because of the Iraq war. Even then, it would have been another 2000 or 2004 if the economy hadn't crashed less than two months before the election.
Bill Clinton and the DLC had done a lot to cement the image of Democrats as moderates in the eyes of voters, and so had the Republicans by controlling Congress during his term and forcing him to adopt centrist, or even conservative policies. Obama and the Democrats tanked in the polls after they forced Obamacare through Congress, circumventing the rules and directly defying the clearly expressed will of the people. When Massachusetts elects a Republican to replace Ted Kennedy for the specific purpose of stopping a piece of legislation, you know that legislation is unpopular. The Democrats exposed themselves as extremists with that act, and lost the support of moderates, leading to 2010.
"Liberal" candidates cannot win nationally, but conservatives can, because the country is much more conservative than it is liberal. A Democrat candidate needs at least 85% of the "moderate" vote to win. A Republican only needs 10%. That split often happens, because most "moderates" are to the left of center, and what they really mean is "moderately liberal". The reason is that the views and policies of the 20% "true left" are
extremely unpopular with voters at large. "Moderates" are more often than not those who want a small amount of liberalism implemented, but not too much.
Americans See Views of GOP Candidates Closer to Their Own
Michele Bachmann and Rick Santorum are considerably closer to the average American's views than Barack Obama is. If he wins re-election it will be because the Republicans failed at their own process, which appears to be very possible, and because voters are satisfied with leaving him held in check by a Republican Congress. He will never be given the kind of majorities he had from 2008-2010 again, that's for sure. And it will be a long time before any Democrat is.