The thief who takes a tool for his own use gains at most the value inherent in the tool. But when apprehended, he must not only compensate the owner for the loss of this value, but also compensate society for the work that it performed to hunt him down, to try him, and to oversee his repayment. The only circumstance where a magistrate may consider imprisoning or executing a malefactor is where his behaviour is such that the magistrate believes that he will offend again, and that he is a liability to society, and should be expelled from society. Here exile is one option. Imprisonment, where a prison is no different from any other society, except that it is closed off from the rest of society, may be another.
Execution is the last resort.
Exile, imprisonment, or execution are not intended as punishments of a malefactor, but simply various ways in which a society rids itself of persons who menace society, or are believed to menace society. All that matters here is the cost of expulsion.