When Jacob blesses his sons before his death, he admonishes Reuben, his firstborn, for a sin he committed and takes away his priesthood (the kehunah) and his kingdom. He transfers the monarchy to Judah. He explains this by saying: "You have delivered my son from being devoured." Rashi explains that Jacob was referring here to two good deeds that Judah performed:
1) He advised selling Joseph and thereby prevented his murder
2) The public confession of her sin in the episode of Tamar, which saved her from being burned.
This is striking: were not the same two virtues present with Reuben? Regarding Joseph, Reuben said, "Let us not end his life," and while Judah sold Joseph for money, Reuben intended to free him completely—"to save him from his hands and return him to his father!".
Also in regard to his repentance for his sin, Reuben was superior to Judah: Judah was obligated to acknowledge his sin, otherwise he would have been the cause of Tamar's death. In contrast, Reuben, although his sin was not a sin in the strict sense, since he "cried out for his mother's vengeance,"4 nevertheless made such a deep and extensive repentance that nine years later, when Joseph was sold into slavery, he was still "occupied with his mourning clothes and his fasting!"5
Reuben was deprived of the monarchy and the priesthood, but not of his birthright, and here lies the crux of the explanation. There is an essential difference between the kingdom and the priesthood and the birthright: the kingdom and the priesthood are fundamentally expressed in service to others. The king directs and manages the affairs of the kingdom; the kohen (priest) blesses the people and teaches them Torah. Unlike both, the birthright is a personal quality that only affects oneself.
Reuben, as the firstborn, was upright. He tried to act to save Joseph. He repented and was a complete penitent for his sin for many years. As far as his own conduct was concerned, it was perfect. But as far as his neighbor was concerned, in practice he did not help him. He did not save Joseph; on the contrary, he caused him to be thrown into a pit full of snakes and scorpions. His repentance was something between him and his Creator, with no relation to his neighbor (and on the contrary, if he had not been preoccupied with "his mourning clothes and his fasting," he might have prevented Joseph's sale and spared the entire descent into exile in Egypt).
In contrast, Judah, despite not having such profound inner repentance, was the one who brought about the salvation of others: he saved Joseph from the pit and Tamar from being burned alive. His steadfastness and self-sacrifice for the sake of others proved that he, in particular, was fit for kingship, which implies caring for others. This is why the monarchy was not transferred from Reuben to Joseph.
In this lies an eternal lesson: it is forbidden for a Jew to focus solely on personal perfection. Disinterest in others can lead to their being "sold out" and become the root of all exiles. A Jew must dedicate himself to loving his neighbor, which is "the whole Torah."7 Thus, even if he himself is not at such a high level, by virtue of his helping others he is bound to "the whole Torah," and in turn hastens the coming of the Messiah and true and complete redemption.
(Likutei Sichot volume 15, Page 439)
NOTES: 1.Our Parsha 49:9 2.Bereshit 36:21 3.Rashi Bereshit 37:22 4.Rashi 35:22 5.Rashi 37:29 6.Rashi Vayechi 49:3 and Onkelus there 7.Tania Chap. 32