Of course he didn't win. That's not relevant to the point I'm making, which is it that Ken Livingstone did about as well as Labour, which did well - but Boris Johnson did a great deal better than the Tories in general, who did badly.
People like a laugh, and Boris is a laugh.