If your confusion is with the concept of "Pichuach Nephesh" let me explain it to you. "Pichuach Nephesh" is a concept in Judaism which means an allowance to wave a commandment of the Law in order to fulfill another more important one. For instance to kill in order to save either one's life or that of another. Also in our case, to eat pork if we find ourselves in a literal condition of starvation without anything else to eat.
In the case of Moses, it happened that, after 430 years of slavery in Egypt, the Israelites had got so used to watch animal sacrifices that they could not think of a religion without blood sacrifices. So, when Moses showed up with the mission to cause the Exodus from Egypt, probably the People had not yet heard of sacrifices in the religion brought by Moses. Probably the Israelites would not move out if that issue was not defined. Realizing that it could be a problem, Moses used of "Pichuach Nephesh" and added the sacrifices but to be done only in the Sanctuary. The end results was that in almost every mountain height the Israelites had build altars to offer sacrifices, not to mention many other problems as a result of that allowance. Hence, Prophet Jeremiah getting sick of the consuming license to sacrifice, he revealed the secret that HaShem had never allowed that sacrifices became part of the religion of Israel. (Jer. 7:22) The Lord seemed to have honored the decision of Moses in spite of all the spiritual disaster
even to cause the final fall of Israel aka the Ten Tribes which was Divinely rejected and God's People reduced to Judah only and only for the sake of God's promise to David that his Tribe would remain as a lamp forever in Jerusalem. (Psa. 78:67-70 and I Kings 11:36)