I was not so much surprised by Obama's answer, as I was by his thinly-veiled anger. Anger may not be the right word, perhaps "perturbed." After thinking about, I should not have been. Obama's been pissed off before in public interactions.
Moreover, for black people, this is the kind of issue that tends to cut across lines of class and politics. I would say that this is the sort of thing that angers upper middle-class black people even more than it angers anyone else, because they tend to be individuals who, by society's lights, are very accomplished. They deeply resent being lumped in with the mass. And more than anyone they resent the whole "when you're black, you talk to the police like this" routine. Obama has lived as a member of that class for a large portion of his adult life, or he's had some concentrated exposure to it--the black strivers roll deep on the South Side. It's not shocking that he was pissed.
One other thing. I'm already seeing stories where reporters are shocked--shocked!--that a guy who thinks that fathers matter, and that kids should be told "no excuses" by their parents, actually would be disturbed by the Gates' arrest. It's the stupidity of dichotomy. Two ideas can't occupy the same brother's brain at the same time. It's against the laws of press coverage.