How is the fact explained that morally evil people can be highly educated in terms of ethics and religion?
The easier way to explain the irony behind the morally evil behavior of people who are otherwise educated in ethics and religion comes down to three words: choice, motivation, and chance (opportunity).
Human conduct comes from choice, motivation, and opportunity. The choice comes when we, as individuals, make the decision to do something. The motivation is the agent that drives us to engage into action, while the opportunity is the combination of elements that enable the action to take place. This happens whether the behavior is morally appropriate, or immoral and inappropriate.
Behavior, whether good or bad, is a combination of learned and inherited habits. What determines whether behavior is "good" or "bad" depends on the accepted tenets of the society in which the behavior is displayed.
This being said, people who are morally aware of the differences between good and bad behaviors may be educated enough to know these differences, but still are not under any obligation to choose one behavior or the another. It is the individual's ttemperament, critical thinking, and understanding of causes and consequences what could ultimately curb any tendency to behave badly.
When we see people such as politicians, preachers, priests, and even teachers committing immoral acts, the first thing that may pop into our minds is: Didn't they know any better? Did they not go to school to learn precisely how not to get into situations of that kind? Since there is never a proper answer to those questions, we simply have to leave it all to unique personality traits, and to the tendency that some people have of engaging in risky behaviors.
Many times those individuals who tend to take huge risks and break the law draw their motivation from that very source: from knowing that they are doing something frowned upon, or that is considered taboo. Others do it because their circumstances render them weak or perverse enough to directly counteract something that has been established. In other cases, the motivation comes from the potential gain that the behavior can bring such as money, fame, and even notoriety.
What is clear, however, is that a person that is morally educated CANNOT claim ignorance when they commit immoral acts. It is precisely their level of education what demands that they abide by the rules and regulations of what is considered socially moral. This is what accountability is about. Hence, when ignorance is not the causative factor of a major fault, then it is personal choice and a tendency for oppositional behavior what should be to blame.