False Dichotomy: you asked about socially unjust laws. The crime rate can fall through an unfair mechanism, and still be unjust.
Example: Jailing all the homeless people would result in homelessness being "solved".
That's totally true.
That's the problem. How to get the one without doing the other (and without all the emotional hand-wringing).
Feed forward control:
Root cause analysis as opposed to treating the symptoms. Certain crimes correlate to disenfranchised environments, and things like access to quality education, basic standards of living etc reduce them.
Some crimes don't show any reduction regardless of enforcement policy: Heroin and drug use has never been as rampant, in every class and level of society: people want drugs, the only way to tackle that is reduce demand which means social change not legal.
Feed back control:
Encourage schemes that reduce recidivism. The American model is one of the worst in the world for recidivism, reduction of that is not a goal of for profit prison. In comparison the Norway model has a tenth of that. The core differences (apart from investment) are one acts as punitive, the other encourages responsibility of the individual and building them a trade to break an obvious repeating pattern.