When it happens, its usually because they're a supporting character. For some reason, people bitch and complain if there's not multiple races in the heroic primary cast, so people are always forced to change things around just to fit that. When they made the Justice League cartoon, they decided to go with the black Green Lantern (the third or fourth most popular, who most people haven't even heard of) just to get a black guy, they added in Hawkwoman (a terrible character) and made her slightly Hispanic to get those, etc. Take a look at commercials. Chances are there's a white brunette guy, a black guy, a black woman, and a white blonde woman. Maybe one of the two guys is even fat to get that in.
So since you need to get at least one woman, at least one black guy/girl, at least blah blah blah, if you've already got a male Caucasian lead, then you need to just give the supporting roles these designations. Since supporting characters aren't as important, they get killed before the protagonist. Thusly, if it follows all those rules, then the black one dies early on.
There's also a reverse-stereotype being created lately as well, due to the whole "why does the black guy have to be the criminal?" kind of PC backlash nonsense. (Not to say the black guy should always be the criminal, but don't look that far into it people, there's no conspiracy). That reverse-stereotype is to now make the black character "the wise man". Morgan Freeman in every role in the past few years? Marvel's Nick Fury is now more accepted as a black guy due to Ultimate Marvel than his former white self...and for good reason, cause the black Nick Fury is a much better character than the old one...but he's still the head of SHIELD and a wise man in that regard.
The only other reason is that its a comedy and it references the old "black people die first" situation. There's no "we should kill the black people off because they're unidentifiable to white people" thing going on, unless you've already done a horrible job writing your film that you make everyone into 100% stereotypes. If you've got the most hardcore Harlem thug type of over-saturated black guy, then yeah, I have nothing to relate to, but chances are if you do that, you're just a horrible writer and I won't identify with ANY of your characters, even if they're a 21 year old white guy with short black hair like myself.