This incident is a case of both sides behaving badly.
When Professor Gates was asked by the police officer to show his ID and show that it was OK to be be in that home, he overreacted. He assumed that the police officer was motivated by racism. He overreacted and became belligerent.
The fact is that Officer Crowley was responding to a report of a break-in. Crime in Cambridge is low and it is an overwhelmingly white community. A black man appears out of place.
On the other hand, Crowley overreacted and arrested Gates for disorderly conduct. This charge (along with loitering) has been historically used by police to arrest those they don't like. Unless Gates threatened him with bodily harm, or he feared for life, Crowley should have walked away. Once Gates showed who he was and that this was his home, the incident should have been over.
Although both behaved badly, Crowley had a special responsibility to defuse the incident. Crowley has the legal power to arrest and incarcerate. When that occurs, even if the charges are later dropped, the arrest record can come back to haunt the victim for years to come.
The moral of the story here is that one should keep one's anger in check when dealing with the police, and the police do not have to arrest every belligerent person they encounter.