People don't pull out a knife then think "wait, but I'll be punished" and put the knife away. What you are proposing feels good but in no way lines up with the reality of society in a contemporary city. If you want there to be less crime you have to treat it as the social class problem it is and find ways to get people access to other ways of living, or if they're ill (mentally or otherwise) get them care and shelter.
That, or we can continue to price people out of being healthy members of our social strata. It's clearly going great in SF