It was a law of carnal commandments given to the Jews at that time who proved unable to live the higher spiritual law:
Hebrews 7:
15 And it is yet far more evident: for that after the similitude of Melchisedec there ariseth another priest,
16 Who is made, not after the law of a carnal commandment, but after the power of an endless life.
The Law of Moses was a system of elaborate rituals and sacrificial rights designed to point them to Christ:
2 Nephi 11:
4 Behold, my soul delighteth in proving unto my people the truth of the bcoming 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:
24 And, notwithstanding we believe in Christ, we akeep the law of Moses, and look forward with steadfastness unto Christ, until the law shall be fulfilled.
• • •
30 And, inasmuch as it shall be expedient, ye must keep the performances and ordinances of God until the law shall be fulfilled which was given unto Moses.
3 Nephi 9:
17 And as many as have received me, to them have I given to become the sons of God; and even so will I to as many as shall believe on my name, for behold, by me redemption cometh, and in me is the law of Moses fulfilled.
3 Nephi 15:
2 And it came to pass that when Jesus had said these words he perceived that there were some among them who marveled, and wondered what he would concerning the law of Moses; for they understood not the saying that old things had passed away, and that all things had become new.
3 And he said unto them: Marvel not that I said unto you that old things had passed away, and that all things had become new.
4 Behold, I say unto you that the law is fulfilled that was given unto Moses.
5 Behold, I am he that gave the law, and I am he who covenanted with my people Israel; therefore, the law in me is fulfilled, for I have come to fulfil the law; therefore it hath an end.
6 Behold, I do not destroy the prophets, for as many as have not been fulfilled in me, verily I say unto you, shall all be fulfilled.
7 And because I said unto you that old things have passed away, I do not destroy that which hath been spoken concerning things which are to come.
8 For behold, the covenant which I have made with my people is not all fulfilled; but the law which was given unto Moses hath an end in me.
9 Behold, I am the law, and the light. Look unto me, and endure to the end, and ye shall live; for unto him that endureth to the end will I give eternal life.
10 Behold, I have given unto you the commandments; therefore keep my commandments. And this is the law and the prophets, for they truly testified of me.
4 Nephi 1:
12 And they did not walk any more after the performances and ordinances of the law of Moses; but they did walk after the commandments which they had received from their Lord and their God, continuing in fasting and prayer, and in meeting together oft, both to pray and to hear the word of the Lord.
Ether 12:
11 Wherefore, by faith was the law of Moses given. But in the gift of his Son hath God prepared a more excellent way; and it is by faith that it hath been fulfilled.
It was required under the Law of Moses nevertheless:
Exodus 12:
44 But every man's servant that is bought for money, when thou hast circumcised him, then shall he eat thereof.
Exodus 12:
48 And when a stranger shall sojourn with thee, and will keep the passover to the Lord, let all his males be circumcised, and then let him come near and keep it; and he shall be as one that is born in the land: for no uncircumcised person shall eat thereof.
Leviticus 12:
3 And in the eighth day the flesh of his foreskin shall be circumcised.
Joshua 5:
3 And Joshua made him sharp knives, and circumcised the children of Israel at the hill of the foreskins.
The Judaizers in the days of Paul likewise required that Gentile converts to Christianity needed to be circumcized, and keep the Law of Moses:
Acts 15:
1 And certain men which came down from Judaea taught the brethren, and said, Except ye be circumcised after the manner of Moses, ye cannot be saved.
The council of Jerusalem described in Acts 15 was held specifically to address this issue. Its verdict was communicated to Christians by a letter beginning with:
Acts 15:
24 Forasmuch as we have heard, that certain which went out from us have troubled you with words, subverting your souls, saying, Ye must be circumcised, and keep the law [of Moses]: to whom we gave no such commandment:
Talking load of rubbish, nonsense, as usual. The Law of Moses was a law carnal commandments, consisting of elaborate rituals and sacrificial rites designed to keep them in constant remembrance of the Lord, and also pointing them to the coming of Christ. Christ fulfilled that law, making it obsolete. But that does not mean that people don't need to keep the commandments of God anymore:
John 15:
10 If ye keep my commandments, ye shall abide in my love; even as I have kept my Father's commandments, and abide in his love.
1 Corinthians 7:
19 Circumcision is nothing, and uncircumcision is nothing, but the keeping of the commandments of God.
1 John 2:
3 And hereby we do know that we know him, if we keep his commandments.
1 John 3:
22 And whatsoever we ask, we receive of him, because we keep his commandments, and do those things that are pleasing in his sight.
1 John 3:
24 And he that keepeth his commandments dwelleth in him, and he in him. And hereby we know that he abideth in us, by the Spirit which he hath given us.
1 John 5:
3 For this is the love of God, that we keep his commandments: and his commandments are not grievous.
Revelation 14:
12 Here is the patience of the saints: here are they that keep the commandments of God, and the faith of Jesus.
Revelation 22:
14 Blessed are they that do his commandments, that they may have right to the tree of life, and may enter in through the gates into the city.