Obstinate heretics who would not recant and desist from preaching their heresies were burned and rightly so. Heretics are a danger to themselves and to the people that they deceive. The pyre upon which they burned emulated the fires of hell. It was typographic of the fires of hell which all of those men and women who the heretic had led astray were headed for.
Of course, today heretics are allowed to express their heresies freely, even within the hallowed walls of the church. Who can tell how many countless thousands or millions of Catholic have listened to them and fallen into heresy and away from the pure faith. Today we have very little concern about this because we mistakenly assume that basically nobody goes to hell for denying the faith. But in times gone by, and especially in those mediaeval days, it was well understood and the church was prepared to act to protect the poor and weak souls which may be deceived by ravening wolves.
In the early church the heretic was excommunicated and banished from the christian community. However when the whole world is catholic, as it was during the mediaeval times in the west at least, this is not so simple, because in banishing a heretic he just goes down the road to the next community and does his damage there. So excommunication really just meant passing the buck and sending the heretic on to someone else to deal with. So having the governance in matters of religion over the whole western world, the church did the responsible thing of executing the heretic.
In that period criminals of all kinds were executed in various ways, and there is no greater criminal than a heretic. Those protestants were incredible hypocrites anyway. No sooner did they break away from the Pope and the floodgates opened. More heretics and witches were burned at the stake in protestant lands in the next few years than had been burned for centuries prior by Catholics. All the worst torture devices were all inventions of the protestants. Never had there been a period of such unbridled barbarism as was released by the reformers. Unfortunately the Catholic church gets blamed for a great deal of the barbaric behaviour of the protestants of the period, which is wretchedly unfair, and Catholics do not do enough in my view to set straight the correct understanding of history.