The law of Moses was filled with types and symbols of the great sacrifice of Jesus Christ. Here's a few verses that explain to me the purpose of the law of Moses, they closely go along with what has already been said.
2 Nephi 11 wrote:
4 Behold, my soul delighteth in proving unto my people the truth of the coming of Christ; for, for this end hath the law of Moses been given; and all things which have been given of God from the beginning of the world, unto man, are the typifying of him.
2 Nephi 25 wrote:
24 And, notwithstanding we believe in Christ, we keep the law of Moses, and look forward with steadfastness unto Christ, until the law shall be fulfilled.
25 For, for this end was the law given; wherefore the law hath become dead unto us, and we are made alive in Christ because of our faith; yet we keep the law because of the commandments.
26 And we talk of Christ, we rejoice in Christ, we preach of Christ, we prophesy of Christ, and we write according to our prophecies, that our children may know to what source they may look for a remission of their sins.
27 Wherefore, we speak concerning the law that our children may know the deadness of the law; and they, by knowing the deadness of the law, may look forward unto that life which is in Christ, and know for what end the law was given. And after the law is fulfilled in Christ, that they need not harden their hearts against him when the law ought to be done away.
Jacob 4 wrote:
5 Behold, they believed in Christ and worshiped the Father in his name, and also we worship the Father in his name. And for this intent we keep the law of Moses, it pointing our souls to him; and for this cause it is sanctified unto us for righteousness, even as it was accounted unto Abraham in the wilderness to be obedient unto the commands of God in offering up his son Isaac, which is a similitude of God and his Only Begotten Son.
Mosiah 3 wrote:
14 Yet the Lord God saw that his people were a stiffnecked people, and he appointed unto them a law, even the law of Moses.
15 And many signs, and wonders, and types, and shadows showed he unto them, concerning his coming; and also holy prophets spake unto them concerning his coming; and yet they hardened their hearts, and understood not that the law of Moses availeth nothing except it were through the atonement of his blood.
Mosiah 16 wrote:
14 Therefore, if ye teach the law of Moses, also teach that it is a shadow of those things which are to come—
15 Teach them that redemption cometh through Christ the Lord, who is the very Eternal Father. Amen.
Mosiah 13 wrote:
27 And now ye have said that salvation cometh by the law of Moses. I say unto you that it is expedient that ye should keep the law of Moses as yet; but I say unto you, that the time shall come when it shall no more be expedient to keep the law of Moses.
28 And moreover, I say unto you, that salvation doth not come by the law alone; and were it not for the atonement, which God himself shall make for the sins and iniquities of his people, that they must unavoidably perish, notwithstanding the law of Moses.
29 And now I say unto you that it was expedient that there should be a law given to the children of Israel, yea, even a very strict law; for they were a stiffnecked people, quick to do iniquity, and slow to remember the Lord their God;
30 Therefore there was a law given them, yea, a law of performances and of ordinances, a law which they were to observe strictly from day to day, to keep them in remembrance of God and their duty towards him.
31 But behold, I say unto you, that all these things were types of things to come.
32 And now, did they understand the law? I say unto you, Nay, they did not all understand the law; and this because of the hardness of their hearts; for they understood not that there could not any man be saved except it were through the redemption of God.
Alma 25 wrote:
15 Yea, and they did keep the law of Moses; for it was expedient that they should keep the law of Moses as yet, for it was not all fulfilled. But notwithstanding the law of Moses, they did look forward to the coming of Christ, considering that the law of Moses was a type of his coming, and believing that they must keep those outward performances until the time that he should be revealed unto them.
16 Now they did not suppose that salvation came by the law of Moses; but the law of Moses did serve to strengthen their faith in Christ; and thus they did retain a hope through faith, unto eternal salvation, relying upon the spirit of prophecy, which spake of those things to come.
Alma 34 wrote:
13 Therefore, it is expedient that there should be a great and last sacrifice, and then shall there be, or it is expedient there should be, a stop to the shedding of blood; then shall the law of Moses be fulfilled; yea, it shall be all fulfilled, every jot and tittle, and none shall have passed away.
14 And behold, this is the whole meaning of the law, every whit pointing to that great and last sacrifice; and that great and last sacrifice will be the Son of God, yea, infinite and eternal.