so for the sake of law and order to be effective u have to show a person with killer instict to stay away from that thought as he might be executed as well.
U know as per islamic teaching the hand of the person who is proved to be a theif should be cut off.Now psychlogically that is something which can prevent anybody from thinking or planning to rob a bank.