Why should homeless people be imprisoned?
Build housing like that for “homeless.” It can be done. We’ve done it before when we were a lot less wealthy.
If they are mentally incapacitated (as most are and proven by the mere fact they want to live on the streets), then involuntarily commit them to insane asylums.