The inner soul connection between Zimri and Kuzbi:
In light of all the above, the question as to how Zimri, a righteous leader of a tribe, can come to commit such a severe sin, becomes all the more intensified. To try to understand this matter we must introduce a journey of reincarnations discussed in Sifrei Kabala, which then give perspective to the situation that Zimri and Kuzbi found themselves in.
In Kabala it explains that Zimri and Kuzbi were reincarnations of Shechem and Dina. The Sefer Asara Mamaros writes as follows: Shechem felt a tremendous love and passion for Dina, as described in scripture, and this feeling came due to an inner soul connection which he had with Dina. Now, how does a gentile share a soul connection with a Jewess? This is because often there is Kedusha hidden within Kelipa, and this Kedusha that was hidden in Shechem had an inner soul connection with Dina and desired to be elevated and purified. [We find similarly regarding conversion, that a gentile who converts is said to have already had a G-dly soul designated for him even prior to conversion, and it is precisely because of this connection with his G-dly soul that he was driven to conversion.] Acting on his passion, he violated Dina and wished to take her as a wife. Dina also felt this connection after her initial violation, and hence Chazal state that she did not want to leave her companionship with Shechem until Shimon promised to marry her. Shimon eventually married Dina, and they had a child who they called Shaul Ben Hakenanis. This person was none other than Zimri. This child was born with the reincarnated soul of Shechem, who Shimon had earlier killed. In revenge of the acts of Shechem, Shimon had also killed 24000 inhabitants of the city. Hashem planned to set up these two individuals, Dina and Shechem, as well as the 24000 men of Shechem, a second time, and place them to a challenge of forbidden relations, and see if they would overcome their previous mistakes. [Although a soul connection did exist between Dina and Shechem, this did not warrant permission for them to be together, as the time of purification for Shechem had not yet arrived.] After Dina’s death, her soul became reincarnated into Kuzbi, and Hashem then arranged for her to meet Zimri, which was in truth the soul of Shechem. The 24000 men of Shechem were reincarnated into the 24000 men of the tribe of Shimon who encouraged Zimri to sin. When Zimri and Kuzbi met, they once again had a tremendous passion for each other and were driven to be together by some unexplainable force. Unfortunately, they did not surpass the test, and succumbed to their inclination, in sin, causing them and the 24000 men of Shimon to die. Now, what led Zimri, a righteous leader, to give into such an inclination? The Mei Shiloach explains that this was because Zimri had prophetic vision, seeing that Kuzbi shared a soul connection with him, contained holiness and would eventually receive a portion in the world to come. That in fact this was very similar to the reason for the marriage of Moshe and Tzipora. Tzipora was also a Midinite woman. Why then did Moshe agree to marry her? This is because he saw in prophecy that she had Holiness within her and would receive a portion in the world to come. Moshe therefore decided to attach to this holiness by marrying her, after conversion. Zimri however, jumped the gun, and became intimate with Kuzbi prior to her conversion, before her sublimation to holiness. The Asara Mamaors does not elaborate further on the journey of these two souls, although it is further discussed in the writings of the Arizal. Rav Chaim Vital explains that the souls of Dina and Shechem, and Zimri and Kuzbi, were later reincarnated into the famous sage, Rebbe Akiva, and the wife of a Roman Aristocrat by the name of Turensrufus. The Talmud writes that the wife of Turensrufes, who was a most beautiful woman, once decided to seduce Rebbe Akiva and make him fall into sin. Rebbe Akiva in response to her gestures spat, laughed and cried. He laughed because he saw in prophetic vision that he would eventually convert her and marry her. This is precisely what occurred. After Rebbe Akiva’s refusal to succumb to her wishes, the wife of Turensrufis decided to convert, and after Rachel’s passing, Rebbe Akiva married her. The journey of the two souls finally came to a proper ending, in which the soul of Dina and Shechem became united in a Kosher way through the marriage of Rebbe Akiva and the wife of Turensrufis, after her conversion, thus elevating the holiness Shechem back to its holy root. A further connection we find between Rebbe Akiva and Shechem, is that Rebbe Akiva had 24000 students who died, which corresponds to the 24000 men of Shechem and of the tribe of Shimon who also died.
 See Yalkut Reuveini Vayishlach p. 59; Asara Mamaros p. 93a; Midrash Talpiyos Giulgulim; Gilgulei Neshamos of Rameh of Puno
 Asara Mamaros p. 93a, brought in Yalkut Reuveini ibid
 See Or Hachaim Hakadosh beginning of Parshas Ki Seitzei
 Asara Mamaros ibid; Yalkut Reuveii ibid; Midrash Talpiyos; However see Gilgulei Neshamos of Rameh of Puno that he was born before Dina was with Shimon
 See Mei Shiloach Pinchas
 Parshas Pinchas
 Sefer Hagilgulim 66; Rameh in Sefer Hagilguilim; Chesed Leavarahm Mayan 3/23
 Avoda Zara 20a