. . . to some degree, being a comedian and being a politician involve the cultivation of two very different kinds of voices. And since Cosby's persona has always involved, to some degree, an element of crankhood (crankitude?), his remarks were more inherently controversial. Comedy, by its nature, courts controversy, where politics seek to avoid it (a rarely successful venture).
I suppose there might be some ageism to the discrepancy in reaction, as well. Being hectored by a an old man who's been artistically obsolete for nigh a decade could well sting a bit more.
That said, I also have to at least suggest that the "similarity" between the remarks ends on that one point. Insofar as Cosby was criticizing absent fathers and rampant materialism, I was with him; insofar as he was trashing urban vernacular an hip-hop culture, he was veering into territory with which I might have some argument. After all, the latter aren't defined entirely by the bling-and-ammo aesthetics of 50-Cent, Jayzee, and the like; there have been acts from Public Enemy and A Tribe Called Quest through the Roots and Dalek that have espoused anti-materialism and underground intellectualism. This is where it's hard for me, at least, not to be a little ageist: It's not much of a stretch to imagine that Obama would be more aware of these nuances than a Cosby, who once all but boasted of the virtue of hating your kids' music in one of his books.
That said, to the degree that Cosby was "blasted" for his remarks, said blasting was surely excessive.