This Law of Moses has only been misunderstood and even ridiculed by people. The sense of justice and fairness encapsulated in it go unappreciated, as there is no effort to understand. It was not always ‘an eye for an eye’ and ‘a tooth for a tooth’ in ancient Israel. Laws were meant to protect the innocent and promote fairness in the administration of justice.
It is not in human nature to avenge an offender the fair way. The avenger usually tries to inflict many times more severe loss on the offender. So, there is a need to set a limit to the extent of punishment that could be meted out to a person found guilty. The 'an eye for an eye' dictum was actually meant to serve this purpose, rather than fixing a fitting punishment for the guilt or crime. The law effectively limits the punishment to a reasonable level and prevents the offended man from delivering an exceedingly harsh penalty on the guilty in return.
The concept of basic human rights was well accepted in ancient Israel where a murderer had a chance to escape unjust punishment without a fair trial by running away and staying in cities, called cities of refuge, designated for the purpose before appearing before a judge for trial. The regulation was made for the sake of any one who killed another person by accident or without an express intent, as while working with an axe or some other implement. More importantly, the law was applicable equally for both the native Israelis and foreigners.
The fairness of the Law can be well appreciated if one looks at the fact that it was promulgated even before the Israelis had entered the Promised Land and began building and living in cities.
It was the well-established Jewish legal system seen among the exiled Jews that prompted the sovereigns of the countries where the Jews lived in exile in later times to prefer the Jews to be their advisors and administrators of justice.
In ancient Israel cities of refuge had been chosen and designated in every part of the country. Joshua, the successor of Moses, originally earmarked six cities of refuge, and the priests added many more in the following times.
-- Joshua 20:7-9 (Today's New International Version)
(Today’s open-air jails are prisons where the convicts spend the sentenced period living within the confines of a large enclosure, with the freedom to move around and engage in activities. They are not kept in narrow cells.)