This is admittedly a bit speculative, but I contend that the following is part of the history of Torah. I simplify to make matters intelligible. There are many reasons and arguments that are not brought down.
Regarding Jewish law, various branches developed. To be able to write about the branches succinctly we notate Sefer Bereshit with G (Genesis), Sefer Shemot with E (Exodus), Sefer Vayikra as L (Leviticus), Sefer Bamidbar as N (Numbers), Sefer Devarim as D (Deuteronomy). M shall mean the section Shemot 20:15-34:26, and H denotes the holiness code, Vayikra 17-26 in our Torah.
The first, and oldest, branch, is (G;E;L/H;N), where L/H means Sefer Vayikra without H, Vayikra 17-26. Jewish law is the original, based on M, i.e., Parshat Mishpatim.
The second branch, newer than the first, and older than the third is (G;E/M;L/H;N;H). In other words, H is the fifth book, and M is removed from E. In other words, H comes to replace M. Note that in tnis branch, there is no mention of the Golden Calf. Jewish law is based on H.
The third branch is (G;E;L/H;N;D). D, Sefer Devarim, is inspired by M but does come to replace it. Rather, it comes to replace H. Jewish law is based on M and D.
The compromise is the fourth branch, (G;E;L;N;D), our Torah. M is not excluded, as in the second branch, and H is not excluded as in the third branch, but included as part of L. Jewish law is based on M, D, and H.