For Luther the true meaning of "church" was: a reunion of people who helps each other and money didn't mattered; but the Roman catholic church in that time needed money to do the "cupola di San Marco" in Rome (Vatican) so they started to sell forgets for the people sins, so the church started to gain money, and the population was sure not to go to hell. Luther believed that to be forgiven people would've repent and than, only by the true regret they could've been saved.
the good works were to help the poor and the ills and staying away from the richness of the superior and selfish church.
(sorry for my bad English, I'm from Italy)