Law doesn't seek to punish but to rehabilitate. Act of taking freedom away from the criminal is violent enough. Treating them badly is just a sign of unfair/poor society that cannot maintain (afford to keep) it's promise to be civil to all citizens.
Must justice include punishment? If someone hits me, I'd much rather they take responsibility, apologise, and work on themselves to become a better person, than simply get locked up for a while.
If the only repercussion for assault is they need to apologize and "work on themselves", then what's stopping more people from committing assault? There needs to be punishment.