If you know anything at all about Kant, you know that this is a dude who did not seek out controversy. Sure, his philosophical ideas were radical, but he was hardly a political rabble-rouser, by any stretch of the imagination. Seriously, he barely left the town where he was born.
But even moderate, cautious Kant could not entirely escape controversy when it came to—you guessed it—religion. Was he an atheist? Not at all—a strong religious sentiment informs all of his writing. But still, Kant's was not an entirely conventional religious perspective, and it became less and less orthodox as he got older.
Kant's trouble began when Frederick William II, the king of Prussia, appointed a reactionary named Wöllner as his minister. In his Religion Within the Limits of Reason Alone, Kant implicitly challenged the authority of the church by suggesting that a good will alone was sufficient for salvation. Wöllner was infuriated and sent a letter censuring Kant and threatening him with dire consequences if he continued to write on religion.
Kant complied with this order (we said he wasn't a rabble-rouser, didn't we?). But when Frederick William II died, Kant asserted that the command was no longer valid and began to write on religious matters again.
Hey, we never said he was a complete pushover.