When the story of this election is written, I suspect that a lot of ink (or at least, electrons) will be spilled over what went wrong for McCain, and the mistakes of his campaign. To me, though, the biggest mistake is looking to be missing the point of a strong campaign.
In particular, I look at the negative campaigning. Both sides have engaged in it, of course -- most modern political campaigns do -- but it's been particularly relentless on the McCain side in recent months, almost abandoning positive ads in favor of negative ones. This seems to be driven by a conventional wisdom that negative ads win campaigns: that statement has been echoed repeatedly in recent months by the talking heads, and as far as I can tell the McCain campaign believes it. The problem is, it's wrong -- or at least, is only half the story.
The thing is, negative ads are often a very effective tactic, but they're not a strategy in and of themselves. When they're simply deployed without sufficient care, you get the effect that McCain is seeing (which is much the same as what happened in the Patrick/Healey debacle): the centrist voters get turned off by the negativity, without being convinced. When that happens, the negative ads become a net negative for you.
Negative ads *can* be very effective, but only when they are in service to a strategy, and that strategy always has to be defining your opponent. If you want to play hardball politics, much of the game is about painting two pictures: a vaguely fuzzy and warm one of you, and a sharply-defined dark one of the other side. To do that, you have to figure out what the voters *don't* want, and make a convincing case that this is what your opponent represents.
The Obama campaign has done this *much* more effectively than the McCain one has. Now partly, that's because they have a much easier sell: one of the most effective negative messages right now is "he's a conservative Republican", and that has the virtue of being unambiguously true. (Obviously, that's not a way to convince the conservative Republicans, but Obama's not going to win their votes anyway. The all-important center is currently more suspicious of the Republicans than they have been in decades.)
But mostly, it's been because McCain has handed them a picture on a silver platter. The original game plan for McCain was to paint this election as being about Experience. McCain clearly wins on that score, they hammered it early and often, and for a while it was working pretty well. But the past few months have seen Obama pull a very smooth disengage and riposte, changing it from Experience to Temperment -- generally related in peoples' emotions, but suddenly switching the advantage. When you look at Temperment instead, Obama has all the advantages that are usually associated with "old and experienced": he's thoughtful, cool-headed, methodical and hard to rattle. McCain, by contrast, has been acting like a stereotypical seventeen-year-old: impulsively changing his mind all the time, making impetuous decisions (the Palin pick is looking more and more like a gift to Obama), and generally looking testy and insecure.
Most importantly, that seems to be what people care about right now. McCain keeps trying to define Obama in terms of the last political war: trying to make him out to be some kind of socialist who hangs out with terrorists. But they're all half-truths, and what people *most* want right now is reassurance that their world isn't about to end -- and Obama is the candidate who has been painted as reassuring. In that light, McCain's attacks look more clumsy than scary, which just continues to play into Obama's hands and solidify his support.
(Admittedly, some of McCain's moves weren't half-bad -- the Joe the Plumber tactic was a good one at first. But in this, as so often in his campaign, they failed to pay attention to the details, and once the details came to light, they undermined the message. Failure to think the details through has been McCain's consistent Achilles heel.)
I won't quite say that Obama's campaign has been a master class in political strategy: they've made some real mistakes, and benefited from luck and timing. But in general, they've done a fine job of formulating a political strategy and sticking to its core, while being supple about refining the day-to-day details. Frankly, it's one of the reasons I've become so fond of Obama: if he's as good at diplomacy as he is at politics (and they are closely related skills), he should do well in many of the arenas a President must face...