Gangs are a complicated topic.
In a workshop we had some time back, the presenters told us that 7th grade is PRIME TIME for recruiting kids into gangs.
And gangs are about belonging. So many kids simply aren't being parented these days -- their parents are either so busy working or so busy with their own social lives that they don't interact with their parents . . . so those kids seek out other surrogate families. And gangs are ready to step in and give those kids a place.
Keep in mind, too, that the gangs aren't simply the gang members. Yes, those hard-core kids "are" the gang, but there are also the girls who are attracted to them, and the slightly unacceptable kids who "want to be bad" and are hangers-on -- they're the kids whom the gang members "use" for this or that purpose but don't actually accept. These kids like to wear the gang colors and hope that they'll be invited in. And ALL of these kids are inclined to be in trouble in numerous ways.
However, these gang kids tend to keep their violent behavior within the gang world. They might steal your middle-class honor student's new iPhone, but they aren't going to shoot him. They aren't the ones instigating school shootings. If they're shooting, it's mostly likely after school and off-campus. And probably over drugs or some perceived insult.