Although the Church was morally responsible for burning heretics, technically it was not the Church that actually burned them; it was the state, after the Church had condemned the person.
The most serious punishment was "relaxation" to the secular arm. The
Inquisition had no power to actually kill the convict or determine the
way they should die; that was a right of the King. Burning at the
stake was a possibility... This penalty was frequently applied to
impenitent heretics and those who had relapsed. Execution was public.
If the condemned repented, they were shown mercy by being garroted
before their corpse was burned; if not, they were burned alive.
The most frequent victims of this practice were Jews and Muslims who converted to Christianity under duress and then "lapsed" or practiced their previous religious customs in private. Thousands of them were executed as heretics.
Biblical basis
The biblical basis for killing people judged guilty of religious crimes, as far as I know, is all taken from the OT. The most famous is "Thou shalt not suffer a witch to live. (Exodus 22:18) This scripture was the primary basis for the 15th c. Malleus Malleficarum which became a standard manual for the persecution of witches as heretics. The book also draws on the works of Aristotle, the Scriptures, St. Augustine and St. Thomas Aquinas. It was given the imprimatur of the Church when it was published together with the Papal Bull Summis desiderantes (Innocent VIII), of Dec. 5th, 1484.
The OT legal basis for for executing heretics is expounded is in Deut. 13:
“If your brother, the son of your mother, or your son, or your
daughter, or the wife of your bosom, or your friend who is as your own
soul, entices you secretly, saying, ‘Let us go and serve other gods,’
which neither you nor your fathers have known, some of the gods of
the peoples that are round about you, whether near you or far off from
you, from the one end of the earth to the other, you shall not yield
to him or listen to him, nor shall your eye pity him, nor shall you
spare him, nor shall you conceal him; but you shall kill him..."
The method of execution in such cases was stoning, not fire. However, there are several cases in which fire might be used for other crimes.
Judah planned to burn Tamar to death for adultery:
About three months later Judah was told, “Tamar your daughter-in-law
has played the harlot; and moreover she is with child by harlotry.”
And Judah said, “Bring her out, and let her be burned.” (Genesis
38:24)
This story is based on the punishment for incest being death by burning.
If a man takes a wife and her mother also, it is wickedness; they
shall be burned with fire, both he and they, that there may be no
wickedness among you. (Lev. 20:14)
Another case of fire being used as a means of execution is found in Joshua 7:
Joshua and all Israel with him took Achan the son of Zerah, and the
silver and the mantle and the bar of gold, and his sons and daughters,
and his oxen and asses and sheep, and his tent, and all that he had;
and they brought them up to the Valley of Achor. And Joshua said, “Why
did you bring trouble on us? The Lord brings trouble on you today.”
And all Israel stoned him with stones; they burned them with fire, and
stoned them with stones."
The closest we come to fire being used against heretics per se is in association with the reforms of King Josiah:
All the shrines also of the high places that were in the cities of Samar′ia, which kings of Israel had made, provoking the Lord to anger,
Josi′ah removed; he did to them according to all that he had done at
Bethel. And he slew all the priests of the high places who were there,
upon the altars, and burned the bones of men upon them. Then he
returned to Jerusalem. (2 Kings 23:19-20)
Some translators render the last line as "he burned their bones upon them."
Why did Christian authorities turn to burning? Since the biblical precedents for burning usually did not involve heresy, we can only surmise that this practice was adopted by legal authorities from non-Christian legal codes for crimes against the state religion. Other possibilities may have been spiritual purification by fire, an anticipation of hellfire, public spectacle, or simply to cause an extremely painful death.
Thus, there was indeed a biblical basis for heresy being a capital crime. There is also a biblical basis for burning as one method of execution, though not for heresy per se. Hopefully the OP is not serious in suggesting we should execute heretics today, either by burning or otherwise.