2 solutions.
A cult of virtue. A monastic tradition where virtue is cultivated intensely and scarily. Put them in charge.
An immortal group mind. A dozen or a hundred people, chipped and networked. Totally mindmelded. Such vast Intelligence and perspective, virtue would be unavoidable. Put that thing in charge.