Much of the background for this question comes from comments and answers to this question: Is the statement "That heretics be burned is against the will of the Spirit." still a statement which is against Catholic truth?
It appears that Roman Catholicism considers heresy at least capable of consideration as a capital crime which may rightfully deserve the death penalty. Here is part of a definition of heresy from Catholic Encyclopedia (1910):
St. Thomas (II-II:11:1) defines heresy: "a species of infidelity in men who, having professed the faith of Christ, corrupt its dogmas". "The right Christian faith consists in giving one's voluntary assent to Christ in all that truly belongs to His teaching. There are, therefore, two ways of deviating from Christianity: the one by refusing to believe in Christ Himself, which is the way of infidelity, common to Pagans and Jews; the other by restricting belief to certain points of Christ's doctrine selected and fashioned at pleasure, which is the way of heretics. The subject-matter of both faith and heresy is, therefore, the deposit of the faith, that is, the sum total of truths revealed in Scripture and Tradition as proposed to our belief by the Church. The believer accepts the whole deposit as proposed by the Church; the heretic accepts only such parts of it as commend themselves to his own approval.
An example of an heretic would be a man who was baptized into, catechized in, and confirmed by the Roman Catholic Church and who later, with full knowledge and assent of will, actively rejects and openly refutes some necessary tenets of Catholic truth such as the Marian Dogmas.
It is not that each and every heretic must be put to death (nor even should be put to death) nor is such a sentence to be carried out in lands where such an action is against civil law. In fact, the death penalty for heresy was most often carried out by secular authorities at the behest of the Catholic Church. While it is not any longer a common practice for heretics to be executed by the Catholic Church (the last heretic put to death was Cayetano Ripoll on 7/26/1826 for the crime of Deism) it has been made clear that if and when a heretic is lawfully put to death for the crime of heresy such an action is, according to Roman Catholicism, in accordance with the Divine Law and is not against the will of the Spirit.
There is some interesting information in response to this question which makes it seem as though the Old Testament could be and has been used to justify the Church condemning heretics to death. Indeed, much Christian support for the death penalty is derived from the Old Covenant. This question is not about the death penalty in general nor it's Old Covenant foundation but specifically regards the death penalty for heresy and how it squares with the teachings of the New Testament.
Using an example where the conviction of heresy is clear and uncontroversial and where the death penalty is rightfully carried out (the reader may insert whichever case they feel fits this bill: (partial list here) where would a Roman Catholic find support for this action in the New Testament and where in the New Testament would they find confirmation that God's Spirit was not against such a thing?