More often than not, people commit crimes because there's no viable alternatives for them. Alternatives to crime are much cheaper than the crime and the effects on communities.
People don't want to be criminals, gangs have to recruit heavily. Like cops and armies, there are risks and rewards and if you have alternatives, you probably would prefer a career that doesn't put you at risk to that degree.