score:4
A heretical, schismatic, or excommunicated priest can consecrate because (III q. 82 a. 7 ad 3):
in consecrating the sacrament he speaks as in the person of Christ, Whose place he holds by the power of his orders
His ability to consecrate doesn't depend on his being in a state of grace but upon his being ordained; the sacramental character of Holy Orders is indelible.
Baptism can be validly conferred by heretics and schismatics, too; God can use an evil instrument for a good purpose.
Upvote:0
Due to a desire for clarification on my answer, here's the short and sweet. The disposition of the minister does not affect those receiving the sacrament or the sacramental power of it. So if the priest is not in a state of grace, the recipient still receives the graces of the sacrament presuming they are in a state of grace.
Here's you answer from the Catechism, the center of which is ex opere operato:
IV. THE SACRAMENTS OF SALVATION
1127 Celebrated worthily in faith, the sacraments confer the grace that they signify.(Cf. Council of Trent (1547): DS 1605; DS 1606.) They are efficacious because in them Christ himself is at work: it is he who baptizes, he who acts in his sacraments in order to communicate the grace that each sacrament signifies. The Father always hears the prayer of his Son's Church which, in the epiclesis of each sacrament, expresses her faith in the power of the Spirit. As fire transforms into itself everything it touches, so the Holy Spirit transforms into the divine life whatever is subjected to his power.
1128 This is the meaning of the Church's affirmation (Cf. Council of Trent (1547): DS 1608.) that the sacraments act ex opere operato (literally: "by the very fact of the action's being performed"), i.e., by virtue of the saving work of Christ, accomplished once for all. It follows that "the sacrament is not wrought by the righteousness of either the celebrant or the recipient, but by the power of God."(St. Thomas Aquinas, STh III, 68,8.) From the moment that a sacrament is celebrated in accordance with the intention of the Church, the power of Christ and his Spirit acts in and through it, independently of the personal holiness of the minister. Nevertheless, the fruits of the sacraments also depend on the disposition of the one who receives them.
1129 The Church affirms that for believers the sacraments of the New Covenant are necessary for salvation.(St. Thomas Aquinas, STh III, 68,8.) "Sacramental grace" is the grace of the Holy Spirit, given by Christ and proper to each sacrament. The Spirit heals and transforms those who receive him by conforming them to the Son of God. The fruit of the sacramental life is that the Spirit of adoption makes the faithful partakers in the divine nature (Cf. Council of Trent (1547): DS 1604.) by uniting them in a living union with the only Son, the Savior.
Upvote:1
I'm glad the OP mentioned the Donatists, because we can look at the question from a different point of view: what if the state of the priest's conscience could affect the validity of sacraments? Imagine a priest who does Really Bad Stuff in secret, while conducting baptisms, marriages, confessions, communions for unsuspecting parishioners. Are their children unbaptized? Are they not married? Donatism opens a huge can of worms. IMHO the Church's position is pragmatic.