Some are criminally minded, in all classes in any segment of society. But there are places some of such influence others to join in collusion and activity dangerous to their segment of society, which is what happens in "ganglands", for there are not such streetgangs forming in every segment of society, or even in most. Such that are influenced might yet remain innocent of that involvement, if they find ways of belonging in meaningful group activity that is more desirable. This could be with such alternatives as afterschool programs that are incorporated in some places. And as in The Cross and the Switchblade, with Wilkerson, and the Victory Outreach, there are useful practices to reach out to some already involved in gangs, for betterment. There wasn't hope to many for such betterment before that example, it not good to go back to that level of hopelessness, when there is that and possible ways otherwise for having intervening approaches to reach people in such environments and in such activities.
Trial and with due process prison would be right for those who commited hard crimes. There are others who haven't come to such who can still be reached, with the right approaches in place to reach such, with people involved that want to do this, this is redemption that is desirable for such that would be in "ganglands" where there is that influence to them.
"I don't mind shootings, as long as the right people get shot." -Dirty Harry.
That's a funny line, for having in a script. But the issue is that it is not ever just the right people being shot.