In this short story, Soapy clearly does think the law is more useful than philanthropy, at least for his purposes.
Soapy is trying to get himself a good place to stay as winter approaches New York City. He does not really have any money, has no job, and does not really want to work.
He could get charity, but he does not want to do that either. This is mostly because the various charities he could go to would require too much of him.
So instead, he wants to get himself arrested. This will allow him to go to jail, stay warm and be fed. He won't be expected to pray or take a bath, or do any of the other things that would annoy him about a charity shelter.
So, the law is clearly more useful given what it is that Soapy wants.