Burning at the stake was, in medieval Europe, the preferred method of execution for witches and heretics. Ostensibly, the reason for this was that, because fire has a cleansing effect, the victim's soul could be saved from hell. So the procedure was actually done with the victim's best interests in mind...
It's difficult to say how strongly people actually believed this, and to what extent it was only a justifucation for using a particularly grisly method of execution in order to discourage others. It wasn't all show; in the last witchcraft trial in Denmark, for example, the victim was granted the mercy of being beheaded and then burned.