Eye for an Eye debates say more about modern concepts of justice than they do about Ancient ones.
First of all, and Eye for an Eye was about limiting revenge, not encouraging it. It meant that punishments fit the crime, so if you poke out my eye, I'm not allowed to murder your whole family.
Next there is no reason to believe that this has to be taken literally. For example, if I take an 'eye' which prevents them from working, perhaps a punishment might be compensation for work lost, which we have today. The misunderstanding about the idea is based on the false belief that Ancient people were stupid and literal.
And why does an eye for an eye suddenly eliminate trials? It doesn't have to do that. Trials and the right of appeal, representation etc. are independent of an eye for an eye.
And is an eye for an eye barbaric, when locking people up in cramped overcrowded cells to be beaten and raped is not?
I think alot of this comes down to a belief that justice is a real thing. It is not, its an abstract, and poorly defined concept. So why do we punish (ideological arguments aside)? Firstly, we punish to discourage people from offending. Of course some people would offend anyway which is the second reason we punish, to remove these individuals from society. The third is to show solidarity and support for the victim(s). The last is as an organizing principle of society. (there may be more but I can't think of any at this point)
Obviously these can be abused, but so can anything.