Throughout much of human history, moral judgements were universalized by reference to an object of faith, a universal and omniscient deity, which today is called the Almighty Algorithm.
The idea of universalized "logical" mortality has been pursued at least since the Enlightenment, and I have no doubt some 19th century thinkers proposed machines for this purpose, great mechanical Ouija Boards that can decide for us. And 20th century thinkers no doubt came up with decision trees and PowerPoint slides.
The problems involved become quickly apparent. Kant's categorical imperative is probably as close as you can get to a universal, internally coherent moral principle. Yet it was nearly devoid of useful particulars in given ethical situations. Confronted with a real moral problem, the Categorical Algorithm would probably burn itself out in an infinite regress towards the "noumenal."
Bentham's "felicitous calculus" meanwhile foundered on its empirical concept of utility. By his definitions, critics pointed out, any pig is happier than Socrates. Mill attempted to save utilitarianism by adding in "higher" and "lower" human values, which today look like the very definition of elitist cultural hegemony.
The reason we use twelve person juries rather that decision trees in court cases is that moral judgements are infinitely complex and situational, both always contingent and always striving for universality. The essence of our moral capacity, as Kant shows, is freedom, our internal "causality" that is autonomous and thus set apart from heteronomous or logically precise forces, such as algorithms.
I do believe the effort to universalize morals is essential but always imperfect. However, if you succeed in devising this algorithm, I might point out that it could easily be turned into a chip capable of inputting "sanctions" and implanted in newborns. Problem of evil, solved!