No different than other single-issue voters like those who only vote for pro life or pro choice candidates, those who pick candidates based on their stance on homosexuality, or people who pick candidates that they think is the "most" Christian or closest to their social conservative stance on an issue like prayer in schools.
Voting for Obama because you are black can be more than just doing it because you're sharing a skin color. He probably felt that Obama and him shared a more common outlook or viewpoint on life. Maybe he felt that Obama would better understand the struggles of being a minority in the United States. He could think that Obama represents the type of social progress he wants to see spread out across the workforce and society in general, where blacks and other minorities are still disproportionately unemployed, underemployed, and earn less money than their white counterparts.
You could just boil it down to skin color, but the vast majority of people vote for people they feel have a viewpoint closest to theirs on one or more issues, and Obama being black prompted a lot of blacks (and minorities like myself) to feel that he was a candidate who would perhaps have a better understanding of social struggles inherent to being a minority in the US, back in 2008 and even now. I mean, do you think Mitt Romney is someone I could relate to as a minority, or Obama? If you're black, who do you think would be more likely to push an agenda that helps me most (even if it never actually pans out that way in real life)?
edit: I just want to point out that what Samuel L. Jackson said was stupid. My point was about the fact that a black person voting for someone because they're black isn't just about being racist.