[Moshiach] the son of David will not come, until all regimes will have turned to heresy.
Rava said: "Which verse alludes to this? - 'It has all turned white: [the leper] is clean.'"
And on this teaching Rashi comments: "Just as when the ailment spreads over the entire skin [the leper is pronounced clean]; so, too, when all regimes will have turned to heresy, the Redemption will come."
If one has leprosy in a few places on ones body, then the person's natural state is normal skin. Therefore, the spots are unnatural, and are therefore Tumah, impure.
But if the whole body is impure, then that is ones natural state, and it is normal for him, therefore this person is not Tumah.
So too regarding the world. If a few nations have heretical, corrupt governments, then one could say, that the nature of man is to be good, and these are the exceptions.
But when all nations become heretical and corrupt, then one realizes, that man on his own, will never develop a perfect government, that is not oppressive to its inhabitants.
Then it will be clear as day, that only the Jews who follow G-d's law, as expressed in the Torah, can bring true peace to the world and mankind- the Geula!
The world is becoming progressively refined, to the point, that it becomes apparent to everyone, that all regimes which are not connected with G-d are heretical; while Jews alone believe and know, that G-d is One.
This awareness, is a stage in the process of the world's refinement; in the course of which, ultimately, "Many shall become purified, clarified, and refined."
On another plane:
When leprosy has spread so much, that the entire body has turned white, then a higher level of Divinity has to be revealed, (Kesser) - in order to cure one of this ailment.
The only way that the world can become pure, is through an intense revelation of a blinding, G-dly light- Moshiach.
In its source above, the leprous ailment is an intense level of Kedushah (holiness) - except that, from this high level it descends into this world, until there develops into the ailment of the unclean leper.
This insight also enables us to understand, why Moshiach is called "a leper."
This state comes about, through the fulfillment of the verse, "He has borne our sicknesses," for through this, the Jewish people undergo the final refinement; which purifies and enables them, to become fit recipients for the sublime Divine illumination of that era.
The Lepros state of Moshiach, is a refining process, of his body and the generation, until it and they all turn "white", meaning that they become completely purified.
Which also means, that good and evil are separated one from the other, so that it becomes clear (pure white not gray), what is evil and what is good.