God told them to do the works, but not for the reason you give, and nothing there says any of those works
justified them before God. All those carnal ordinances had but
one purpose, and that was as a yearly remembrance of sin, and pertained only to a temporary appeasement of their
conscience. "By the law is
the knowledge of sin"
Heb. 9:9-10 Which was a figure for the time then present, in which were offered both gifts and sacrifices, that could not make him that did the service perfect, as pertaining to the conscience; Which stood only in meats and drinks, and divers washings, and carnal ordinances, imposed on them until the time of reformation.
Heb. 9:13-14 For if the blood of bulls and of goats, and the ashes of an heifer sprinkling the unclean, sanctifieth to the purifying of the flesh: How much more shall the blood of Christ, who through the eternal Spirit offered himself without spot to God, purge your conscience from dead works to serve the living God?
Hebrews 10:1-3
For the law having a shadow of good things to come, and not the very image of the things, can never with those sacrifices which they offered year by year continually make the comers thereunto perfect. For then would they not have ceased to be offered? because that the worshippers once purged should have had no more conscience of sins. But in those sacrifices there is a remembrance again made of sins every year.
Now, YOU go think about it some more, and while you're doing so, read the verses I gave you again.
Acts 13:39 And by him all that believe are justified from all things, from which ye could not be justified by the law of Moses.
Romans 3:20 Therefore by the deeds of the law there shall no flesh be justified in his sight: for by the law is the knowledge of sin.
Romans 4:2 For if Abraham were justified by works, he hath whereof to glory; but not before God.