I'm both surprised and not surprised that he got out so soon. Before Tuesday, there was talk that he would withdrawal if he didn't win or at least do very well in California. However, on Tuesday night he said (albeit before the California results came in) that he was going all the way to the convention no matter what. In any event, his prompt withdrawal probably helps whatever political future he has (maybe in a run for Senate somewhere).
As for why he lost, there are many pieces out there addressing that, and after today there will be a lot more. I think the best one I've seen is this WSJ editorial; the authors argue, essentially, that Romney never really grasped how different being a political leader is from being a business leader.