Actually they do have jobs - it's mandatory in most cases to work. Either doing something that keeps the infrastructure of the prison running, or makes the prison money with which to feed you.
The food is free, but pretty terrible usually. The healthcare is free, but pretty terrible usually. You have a place to sleep, but no privacy. You have a gym and a courtyard, but it's the same gym and courtyard every day for the duration of your sentence. No walks to new places, or new scenery, ever.
And prisons are not all created equal. Depending on the crime, you'll be spending time in a prison that's either low security and relatively comfortable and safe, or a prison that's high security, extremely restrictive, and where you'll live in fear of being gangraped or shanked for a stupid reason or no reason.
Russian prisons are pretty horrible places to be. Canadian prisons are way too kind, even the ones that house serious criminals like murderers.
In prison, you also can't smoke or drink, and if you're someone like me who thinks/thought "If I was ever imprisoned I'd just have my family send me books and shit and literally read and sleep and stay in my cell and never leave it or talk to anyone until my sentence was up," well think again cause like I said there is a lot of mandatory and regulated shit in prison. Mandatory work duty, mandatory communal showering and eating, mandatory get-the-fuck-out-of-your-cell block times as well, every single day.
Prison is not fun, but unfortunately it's not so horrible to prevent some people who are non-functioning in actual society to feel safer and happier there, because they know who they are and what they are supposed to do there.
But, I'm sure a lot of homeless people would be glad to be fed three times a day, and be able to shower, and have a bed (not a warm or comfortable bed, but a bed all the same), even if it meant being part of a forced labor crew that makes license plates all day.
So why don't we have prison-like systems for homeless people?
Well, we used to actually. In the 1800's there was such a thing as work houses, where destitute or homeless people could go and sign themselves up. Usually they were not paid for their labor, the hours were killer long, the food was bad and there wasn't much of it, forget about days off, and don't get sick or lose a hand to machinery cause then you're REALLY fucked.
Workhouses were somewhere you could go, and in exchange for your work and your sobriety (no drugs or alcohol allowed), you could eat and sleep indoors, but they were such shitty places to be, and there was such great shame and judgment laid upon anyone who went to the workhouse, that no one wanted to unless they had literally no other choice, and then, for as short a time as possible.
But then some people decided workhouses were bad, shaming people who went to workhouses was bad, the conditions were bad, basic human dignity was not being maintained, etc. Now we have no workhouses. Now we have soup kitchens, overcrowded shelters where people sleep on the floor, and if anyone is turned away they can sleep on a park bench and hope some teenager doesn't come and set them on fire in the night.
If you ask me, workhouses were a better system for the homeless, and prisons should be more like workhouses so that people REALLY do not want to go to jail, and therefore, don't commit dumbshit crime on impulse.