> if we were able to use AI to generate laws in an objective and logically sound way ... we'd be much better off.
A major role of judges is specifically to not do that because there are circumstances that will not have been thought of at the time of a law being written, new laws will be written that interact in unforeseen ways with existing laws and/or common views on justice can change over time.
It may be technically illegal to destroy a person's property but no judge is going to convict someone who breaks down a person's front door because they heard someone crying for help inside. That's a simple example but there would have to be enumerable exceptions to every single law for an objective/logical AI to do justice.
Rather than try to enumerate the enumerable, we let judges judge.