Well it depends how the AI operates, is distributed, etc. Any AI that affects people and populations in multiple regions will need to adapt to the laws in those different regions. Which could mean a lot of extra complexity, even if you limited it just to the US.
You can't assume the same AI setup that'd work fine in the US would work in the UK or vice versa, because the laws aren't consistent about many elements. Either way, it's still a complicated thing to figure out.
If we can derive morality from first principles, why hasn't someone applied this to the legal system yet?
If we can't derive morality from first principles, why would we need to invent that for world changing technology to happen?
Wouldn't it be a lot more in line with the population's sense of morality to train the AI based on our current laws than on some generalizing philosophical view?