To best discuss this, and I was hoping CAlvin would be first but ML will do, we should look at exactly what he was charged with.
First, a little background from History.com
On January 3, 1521, Pope Leo X issues the papal bull Decet Romanum Pontificem, which excommunicates Martin Luther from the Catholic Church.
Martin Luther, the chief catalyst of Protestantism, was a professor of biblical interpretation at the University of Wittenberg in Germany when he drew up his 95 theses condemning the Catholic Church for its corrupt practice of selling indulgences, or the forgiveness of sins. He followed up the revolutionary work with equally controversial and groundbreaking theological works, and his fiery words set off religious reformers all across Europe.
In January 1521, Pope Leo X excommunicated Luther. Three months later, Luther was called to defend his beliefs before Holy Roman Emperor Charles V at the Diet of Worms, where he was famously defiant. For his refusal to recant his writings, the emperor declared him an outlaw and a heretic. Luther was protected by powerful German princes, however, and by his death in 1546, the course of Western civilization had been significantly altered.
If you note, the bull was issued after the Diet of Worms, showing that he had a day in court.
This is from this site
The time limit of 60 days set by the Bull Exsurge Domine, during which Martin Luther was supposed to make an act of obedience to the Pope, expired on the 27th November 1520, after copies of the papal bull had been put on the doors of the Cathedrals of Meissen, Merseburg and Brandenburg, and after the German friar received the original document, he burnt it with contempt. Since Luther decided to proceed along his way (in suo pravo et damnato proposito obstinatum), the Pope had no other choice than to carry out the threat clearly announced in the document of the 15th June 1520.
So he had been given more than one chance to recant and defend his actions.
Now, did the Church have the authority to do this? Yes. Even without any Scriptural evidence, one must allow the Church the ability to choose who is a priest and even a member of it. Even Protestant Churches would conceed that point