Young Villefort is the closest thing we get to a foil for Edmond. He's young, he's lucky in love, and his job prospects are good. Oh, and in case the parallels weren't clear enough, his betrothal feast takes place at exactly the same time as Edmond's. The Villefort we're first introduced to is a man of principle. He takes his job seriously; he understands that every time he squares off against a defendant in the courtroom, the stakes are terribly high:
"Most interesting, indeed, Mademoiselle, since it is a veritable drama and not an invented tragedy, real sorrows in place of ones that are merely feigned. The man that you see there, instead of returning home, one the curtain is lowered […] is taken into a prison, there to meet his executioner." (6.38-39)
His fiancée, the winsome aristocrat Mademoiselle Renée de Saint-Méran, isn't a fan the whole power-of-life-and-death thing, and Villefort takes that in consideration when he's called to deal with the suspected Bonapartist, Edmond Dantès. He really does give Edmond the benefit of the doubt – he's ready to send him on his way until the very last moment; that is, until he sees his father's name on the message Edmond was meant to deliver.
This is the moment everything changes: Villefort goes from being an impartial, honest young prosecutor to a scared, self-interested man. It's hard to blame him for trying to preserve his reputation – he's protecting his father as well – but the thought that follows immediately after is what's really damning. Villefort could have just disposed of the letter, released Edmond, and told everyone that the whole incident was no big deal, but instead he chooses to change the very thing that could have been his undoing into the career opportunity of a lifetime. He doesn't merely preserve himself; he furthers himself at the cost of another man's well-being.
Now, you can't call him all bad – he does, at the very least, help to protect his father – but, when you get down to it, he's a pretty despicable sell-out, and it's a shame to see such promise and talent put to such terrible use.
Villefort is a prosecutor, so he'd understand if we arraigned for his offenses against humanity, right? Let's see what we can come up with: