From Summa theologiae II-II.11.3:
Article 3. Whether heretics ought to be tolerated?
Objection 1. It seems that heretics ought to be tolerated. For the Apostle says (2 Timothy 2:24-25): "The servant of the Lord must not wrangle . . . with modesty admonishing them that resist the truth, if peradventure God may give them repentance to know the truth, and they may recover themselves from the snares of the devil." Now if heretics are not tolerated but put to death, they lose the opportunity of repentance. Therefore it seems contrary to the Apostle's command.
Objection 2. Further, whatever is necessary in the Church should be tolerated. Now heresies are necessary in the Church, since the Apostle says (1 Corinthians 11:19): "There must be . . . heresies, that they . . . who are reproved, may be manifest among you." Therefore it seems that heretics should be tolerated.
Objection 3. Further, the Master commanded his servants (Matthew 13:30) to suffer the cockle "to grow until the harvest," i.e. the end of the world, as a gloss explains it. Now holy men explain that the cockle denotes heretics. Therefore heretics should be tolerated.
On the contrary, The Apostle says (Titus 3:10-11): "A man that is a heretic, after the first and second admonition, avoid: knowing that he, that is such an one, is subverted."
I answer that, With regard to heretics two points must be observed: one, on their own side; the other, on the side of the Church. On their own side there is the sin, whereby they deserve not only to be separated from the Church by excommunication, but also to be severed from the world by death. For it is a much graver matter to corrupt the faith which quickens the soul, than to forge money, which supports temporal life. Wherefore if forgers of money and other evil-doers are forthwith condemned to death by the secular authority, much more reason is there for heretics, as soon as they are convicted of heresy, to be not only excommunicated but even put to death.
On the part of the Church, however, there is mercy which looks to the conversion of the wanderer, wherefore she condemns not at once, but "after the first and second admonition," as the Apostle directs: after that, if he is yet stubborn, the Church no longer hoping for his conversion, looks to the salvation of others, by excommunicating him and separating him from the Church, and furthermore delivers him to the secular tribunal to be exterminated thereby from the world by death. For Jerome commenting on Galatians 5:9, "A little leaven," says: "Cut off the decayed flesh, expel the mangy sheep from the fold, lest the whole house, the whole paste, the whole body, the whole flock, burn, perish, rot, die. Arius was but one spark in Alexandria, but as that spark was not at once put out, the whole earth was laid waste by its flame."
Reply to Objection 1. This very modesty demands that the heretic should be admonished a first and second time: and if he be unwilling to retract, he must be reckoned as already "subverted," as we may gather from the words of the Apostle quoted above.
Reply to Objection 2. The profit that ensues from heresy is beside the intention of heretics, for it consists in the constancy of the faithful being put to the test, and "makes us shake off our sluggishness, and search the Scriptures more carefully," as Augustine states (De Gen. cont. Manich. i, 1). What they really intend is the corruption of the faith, which is to inflict very great harm indeed. Consequently we should consider what they directly intend, and expel them, rather than what is beside their intention, and so, tolerate them.
Reply to Objection 3. According to Decret. (xxiv, qu. iii, can. Notandum), "to be excommunicated is not to be uprooted." A man is excommunicated, as the Apostle says (1 Corinthians 5:5) that his "spirit may be saved in the day of Our Lord." Yet if heretics be altogether uprooted by death, this is not contrary to Our Lord's command, which is to be understood as referring to the case when the cockle cannot be plucked up without plucking up the wheat, as we explained above (10, 8, ad 1), when treating of unbelievers in general.