This section opens with a description of the rich rewards of studying Torah, both in this world and the World to Come. Those who neglect study, we are told, receive punishment. As Rabbi Yehuda points out, the children of Israel were exiled from the Holy Land because they abandoned the Torah. The discussion moves from various interpretations of the "empty pit" to the actions of Joseph's brothers - including Reuben's repentance and redemption, the punishment of Jacob, and the removal of Judah as king of the tribe.
Kabbalistic concepts of retribution are not based on a Creator who metes out penalties and rewards. The Light of The Creator is a Divine Force whose only attributes are sharing and goodness. This can be compared to an electrical current - which can bring light to a city, or can be destructive if we carelessly poke a finger into a wall socket. Our own free will determines whether we short-circuit [receive punishment] or turn on the "light switch" [gain reward]. The Torah is a blueprint to show us how the universe is "wired," so that we harness spiritual forces in a positive and productive way. This wisdom and enlightenment comes to us through the intricate "wiring" of the words that compose these passages, and the spiritual Light they emit.