This week's Parshah documents another tragic episode in the history of our nation. Korach, and his entourage, create a מחלוקת; a bitter conflict against Moshe and Aharon, which ultimately ends in their tragic death.
Of course, as with any of the other sins of the exalted generation of the דור המדבר, we cannot fully understand this episode. Especially given the illustrious standing of Korach himself, the machlokes he created and his eternal demise are even more difficult to understand. Rashi says that Korach was a פקח, a wise man. How then did he fall for such a lowly sin?
Rashi explains that there was a reason why Korach allowed himself to fight what he thought was a "holy fight". He saw with רוח הקדוש that he is destined to be the father of a שלשלת גדולה a great chain of holy descendants. He saw that Shmuel, the great navi who was שקול כנגד משה ואהרן equal to Moshe and Aharon, was to descend from him. Additionally, he also saw that there would be another כ''ד משמרות, twenty-four groups blessed with nevuah, descended from him. This all strengthened him to start, and to continue with this conflict. He reasoned that if he is the father of such greatness, then surely, he is doing the correct thing. Rashi says that Korach thought "So much greatness will come out of me, and I will be silent".
Secondly, he reasoned that if all these holy generations were to come out of him, then that demonstrates that he will not be punished for this fight. Korach's children joined him in fighting Moshe, and if all of them would die, then they would have no further generations. So, his Ruach Hakodesh led him to believe that he is engaging in a worthy battle, and that he and his children will not receive Divine retribution for it.
From this, seforim derive that Korach merited Ruach Hakodesh. Indeed, he interpreted the Divine revelation in an incorrect manner, but it still demonstrates that he was a very holy individual and that his motives for this conflict were deeper than what we can understand.