The only thing that is more dangerous than a gang member with a weapon is a parent or an educator in denial. There's no excuse for parental ignorance. Turning their head and looking the other way can lead the kids into gangs in the first place.
The reasons change from kid to kid. We can't say that a child joined a gang for x, y and z. The one common thing is that gangs give their members something that is not being provided anywhere else. It can be camaraderie, money or drugs.
Schools don't create gangs or promote them, but it is their problem. It's important that they don't try to negate their responsibility to manage the safety issues of their campus and to try to educate kids about the dangers of gangs.