I do NOT concede that as the KEY purpose. And when you call "protecting society from criminals" the key purpose of the justice system you wind up with the horribly broken mess that is the US justice system.
Yes, A purpose of the justice system is to remove from society those who cannot be trusted.
But another purpose of the justice system should be to rehabilitate those who can be. And the US justice system is HORRIFIC at that. If anything, the US justice system is a net negative on rehabilitation. The way the US system throws everybody together does more to let old criminals teach new ones their tricks than any improvement from any rehabilitation program can counteract.