Punishing crime has a disproportionate negative consequence on those who have already been traumatised by the circumstances of their lives.
So I agree with your point about everyone's needs being met, but we can't have that until we, collectively / globally, make some significantly different choices.
So we'll probably have to continue getting by with an obviously suboptimal crime and punishment system.
Edit: fixed a word
Assuming this is actually true, it would be so only because we disproportionately let rich people off with a slap on the wrist, not because poor people commit more crimes. (rich and poor being imperfect proxies for whose lives suck more or less)
Plenty of people are just selfish and don't care that other people got hurt, like the Theranos debacle. That hurt many people and was perpetrated by very privileged individuals, not poor schmucks whose lives sucked from the get go.
I would like to see more focus on crime prevention by helping everyone get their needs met, not criminalizing things where no one is victimized, etc.
But once the deed is done, I don't know that it really works to not have some element of consequences, unfortunately.