In the end of the first chapter of Berochos ,12b it says that Chazal wanted to insitute parshat Bolok as the third chapter of Keriat Shema as it mentions yetziat mitzrayim.(They didn’t add it due to it’s length).
However the Gemora in Bova Basra 14b says that Moshe Rabenu wrote the Torah and the portion of Bilom. Taking this at face value, it appears that parshat Bilom is a) not an integral part of the Torah- is it an added piece? and b) contradicts the Gemoro that Chazal wanted to make Parshat Bilom part of Kriat Shema as it wasn’t part of the Torah ?
In Yevomos 49b the Gemoro describes the difference between the prophecies of Moshe and other prophets.
Moshe’s prophecy is described as ‘aspaklirya hamiro’ seeeing through a clear glass, whilst the other prophets saw from a non clear glass – ‘aspaklirya sheino meiro’. Moshe Rabenu was able to see everything with clarity due to his achievement of great heights, as the Torah testifies ‘Velo kom novi oid beyisroel keMoshe’ ( Devorim 34 10). The other prophets saw their prophecies from a frosted glass as they didn’t reach the madrego of Moshe Rabeinu.
The Sifri in Devorim (ibid) says ‘Velo kom novi oid beyisroel keMoshe, beyisroel lo kom’ meaning that in the nations of the world there was such a person who had arisen, namely Bilom, as his prophecy was equal in clarity to Moshe. How can we understand this as Moshe was the greatest of men whilst Bilom was the lowliest of mankind? (Avot Chapter 5, Mishna 22 ).
What was Bilom thinking when he went to curse Klal Yisroel after Hashem explicity told him not to curse them and how did he think he would be able to curse them?
The Mahril Diskin explains that Bilom thought that the prophecy he would get wouldn’t be clear. This would enable him to interpret it the way he wanted, as each prophecy is a mirror image of the individuals own madrego, thus it would allow him to curse Klal Yisroel.
Hashem in His most infinite kindness gave over this prophecy ‘beaspekliro hameiro’ – in a clear vision like the prophecy of Moshe in order that it should be turned into a blessing.
This is what the Sifri meant,- in the nations of the world there was a prophet like Moshe – Bilom ,but just this once and at that moment in time.
With this knowledge we can explain the Gemoro in Bovo Basra that when Moshe Rabeinu wrote down the Torah he wrote it with his clarity of prophecy. When it came to writing down parshat Bilom, since Bilom saw ‘beaspekliro hameiro’ Moshe had nothing to add, he just transcribed it.
This also clarifies how the Parsha of Bilom is of course an integral part of the Torah but didn’t become part of Kriat Shema due to its length.
We can see from here how Hashem is always looking out for us, and constantly bestowes upon us with great kindness.