Martin Luther was not excommunicated for speaking out against corruption but for teaching heresy. If he had limited himself to attacking corruption and immorality he would be counted as a saint today as have many others who did just so.
BTW, how was Luther speaking out against immorality when he approved Phillip of Hesse to commit bigamy?
Have YOU read the 95 Thesis?
Which ones do you disagree with and why?