Before 1517, the Catholic Church began to practice indulgences selling. Martin Luther was horrified by this practice, and on that occasion he sent a letter to the Archbishop of Meinz to explain his views on it. The Pope considered that Luther's attitude was heretical and excommunicated him from the church.
In the beginning, Martn Luther, who had a pure vision of Christianity and salvation through grace and faith, could not guess where his attitude would lead him and would fall into the displeasure of the Pope. Initially, he did not realize that the teachers of the church were fake and that they led the nation into ruin, because they were exclusively busy with their own interests and progress in the church hierarchy. So, he did not see himself at the head of a movement that would separate from the church, because at first he thought that a reform could be possible within the church itself.
Later, over the years, he realized that this reform was not possible, calling Papasy an antihrist and that the Pope's fictitious men were fake Christians. As he said, Luther dispersed with the Pope in attitudes, because the Pope claimed to be immaculate and sinless, that he was the head of the church and that no one should oppose his power.
Answer: from someone who wanted changes within the church, he changed the view that the arrangement with the church was not possible which led to the establishment of a Protestant Church.