When I started working at public housing in the early 2000s, I came with this notion that people my age didn't have jobs or didn't work hard enough. What helping friends with their resumes taught me was folks often pursue jobs doggedly -- but because of their race, background, and education, find themselves in dead end work.
It seems to me the classic economic arguments you're making need to be turned around: In an environment where the options in the mainstream economy are unstable, low-reward work and you lack the capital to secure credit to get an education or make serious investments, wouldn't you think about joining the drug economy?
Also both the gangs and community groups were entirely capable of self-governing.