The Ramban notes the fact that when the Torah recounts Klal Yisrael’s iniquities, it mentions the conflict in which Dasan and Aviram participated. It does not, however, mention the leader of the conflict, Korach. He explains that Korach transgressed in an invidious manner, by offering a strange fire for the ketores. This precluded his name from being “remembered” in the Torah. The Ramban’s words lend profound insight into the character of those whose names are mentioned in the Torah. It also indicates that mention in the Torah — even as a scoundrel — is still viewed as meritorious.
Horav Chaim Elazary, z.l., offers a different perspective for the exclusion of Korach’s name from the Torah. Korach’s behavior, albeit reprehensible, was justifiable in his own mind. His contention had a “purpose;” he had a definite goal which he strived to achieve. Korach desired to be the Nasi of Shevet Levi and, ultimately, the leader of Am Yisrael. This burning desire, this perverted sense of mission, was all Korach needed to drive him to his own doom. He did have a mission; he was performing an act which he could, in his own mind, rationalize.
Dasan and Aviram, on the other hand, were nothing more than bitter miscreants. Their acrimonious nature led them from conflict to conflict, seeking out to undermine everything and everyone with whom they came in contact. They had no goal other than conflict, no rationale other than contention. They were truly the embodiment of balei machlo’kes, people who constantly involve themselves in dispute. This malevolent character “earned” them entry into the Eternal Book, the Torah.