OK, try this on for size. Suppose that we divide Gérard de Villefort's life in two parts: before Edmond Dantès and after Edmond Dantès. With us so far? OK. So, back before Edmond came on the scene, Villefort was a young, successful but conscientious crown prosecutor, with a young, loving, conscientious wife. After Edmond, well, he lost Mlle. St.-Méran and found a new wife, the woman who would be come Héloïse de Villefort. Héloïse is everything post-Edmond Villefort became: ambitious, jealous, and unscrupulous. In a way, she's exactly the kind of wife he deserves.
Well, not quite – nobody deserves to have a psychotic serial poisoner for a wife, but you get the picture. Héloïse kills for the same reason her husband locks up Edmond: she's looking out for her own interests, and the interests of her son, Edward, and she's willing to poison her way into an inheritance in order to get the financial security she craves.