Outrage and widespread condemnation has followed Israel legalising the death penalty for Palestinians.