"If he has turned completely white, he remains pure" [Tazria 13:13]
R' Yochanan in Maseches Sanhedrin [98a] taught: "Mashiach, the son of David, will only come to a generation that is either entirely meritorious or entirely guilty".
This statement is difficult to understand, noted the Chasam Sofer (R' Moshe Sofer). For while it is easily understood why a generation that is entirely meritorious would be worthy of receiving Mashiach, on what basis would a thoroughly guilty generation receive him?
We find a similar difficulty in the verse: "If he has turned completely white, he remains pure". If a small affliction is considered impure, why is it considered pure when it covers the metzora's entire body?
We can answer both questions with one answer. Skin afflictions come upon an individual in order to inspire him to repent for his misdeeds. Now, if his entire body has turned white, he will definitely be humbled to repent completely and sincerely. There is therefore no need to declare him impure.
The same applies to a generation that is completely guilty. The way to awaken a generation that is full of sin is not with reproach but by sending them Mashiach ben David. Then they will return to Hashem in complete repentance.
Source: Rabbi Yisrael Bronstein
The Talmud states: "The son of David [Moshiach] will only come when every government becomes heretical".
Rabah said: "Where do we see [an allusion to] this in Scripture? From the verse: "he has turned completely white, he is ritually pure." [Sanhedrin 97a]
Rashi explains: "Just like when the affliction has spread throughout the entire skin the person is ritually pure, so too when all the governments have become heretical, the redemption will come."
This sign of redemption could be seen as either:
a) A negative sign, that people have become so corrupt that G-d is forced, so to speak, to save the world and bring redemption.
b) A positive sign, that the world has become so refined that it is clear to everybody that any regime or government which is not based on Torah is heretical and corrupt.
This parallels the two views expressed above:
a) If the corruption of governments is a negative sign, it follows that G-d is "forced" to bring the redemption, so to speak, despite the world. This corresponds to the view that the law ("he has turned completely white, he is ritually pure") is a super-rational decree of scripture, which is followed despite the fact that it is illogical.
b) But if the corruption of governments is a positive sign, it follows that G-d is bringing the redemption because the world has become good. This corresponds to the view that the law is logical.
Source: Based on Likutei Sichos Lubavitcher Rebbe