You can't claim to protect society from anything without protecting individuals primarily.
Society is not a herd in which you sacrifice an individual to save the rest.
The prisoner would undoubtedly have a better life if not imprisoned. But society does better if they are imprisoned.