So, it seems that segregation implies: There is something wrong with the individual, therefore we have to keep them from being within harm's reach of the general populace.
This is a binary, on-off mechanism. That is why society, I guess, opted for unpleasant segregation, as a means of doling out a variable "fix" to the problem (mild for petty crimes, heavy for serious ones). Otherwise, you'd have to segregate each individual that ever does any sort of wrong, or breaks any violent law, etc.
How is "segregation, not punishment" materially different from what we do now with prisons.
It's still not at all an easy problem to solve--a whole lot of what makes prisons so shitty is the other prisoners, but enforcing a total isolation on the criminal from anyone he may hurt or be hurt by is probably more harmful than a shiv, which is the deep tension that any solution will have to work around. But the bigger thing standing in the way of a solution is the belief of most people, which is rarely even thinly veiled, that most criminals deserve whatever they get.
Which is understandable: many times (most of the time?) the criminal has actually done something heinous, and I suspect we're programmed to depersonalize and even hate people who commit asocial crimes. But it does lead to barbaric results that a civilized society should reject.
ETA: Just to be explicit that there are ways to make the experience of prisons better: don't charge a prisoner $20 for a 15 minute phone call. Allow them internet access. And, more controversially, implement the panopticon--right now there's little to no accountability for the things that happen within prison walls.