Never forget that a villain is a hero in his own eyes. He believes he is totally justified in what he’s doing.
As the author, you need to find that justification. The dysfunctional childhood is an overworked trope, but I’m sure you can come up with a LOT more reasons why good people do bad things. Revenge. Greed. Jealousy. Those are the big ones. But there are probably others as well.