As I've said before about the supposed violence that "gangsta" rap causes, it's an attempt at "correlation = causation", except there's no correlation. The usual causes of violence are actually either organized crime (usually related to drug sales), pure desperation (seen in many small street sets), and the complete lack of police-community relations leading people to find violent solutions to conflicts rather than bother with police.
It's worth remembering that "gangsta" rap is something of a fake genre, a label created by people who decried the supposed glorification of violence, that was then taken on by the musicians themselves. As with many music styles, a "gangsta" rapper may revel in violence, or may describe and decry it, but since the detractors rarely know what they're talking about to begin with, it all gets lumped in under the same umbrella.