Anyone considering this question should read Joseph Weizenbaum's 1976 book, Computer Power and Human Reason.
He considers if an AI could be a good judge, and decides that it would not. Even though all the facts, rules and heuristics could be fed into an AI judge, the element we would not be able to program is human compassion. He concludes that even though there are some tasks a computer might be able to do, there will always remain some decisions that should always be made by humans.