Israel has become the first country to vote in favour of capital punishment in the 21st century.