He was excommunicated because he was a heretic. Sola scriptura and sola fide are false and heresy.
The Protestant Reformation began because a multitude of other members of the Church (teachers of the Church, mind you - other monks, priests, theologians, etc) agreed with Luther's arguments - he was simply expressing out loud what many of them thought privately but kept to themselves for fear of being burned at the stake. They were all heretics? They were all demonically inspired? Doesn't say much for the soundness of the Church's teaching if they couldn't defend against Luther's arguments with anything other than the stake and excommunication. Why didn't they send their best theologians to defend against his arguments? (Because they couldn't, they knew indulgences were wrong and nothing but a money making scheme, just like "buying" people out of "Purgatory").
Luther's "Hear I Stand" speech is as righteous and holy as any sermon I've ever heard. That came straight from God, and of that I have no doubt.