Abraham's work may have justified him before God....however you should also realize that Abraham was justified by his faith alone all the way back in
Genesis 15:6...it is written that God counted his faith to him at that time as righteousness.
You assume that being justified by faith is the end of the story and nothing further is required for salvation. But that is incorrect: Having being justified by faith, God then tests our faith, and he tests our faith by our obedience to his commandments - ie, our WORKS. That is what you don’t understand. Salvation requires
TWO JUSTIFICATIONS: (1) Justification by FAITH, which is followed by (2) justification by WORKS (James 2:24). Being “justified by works” is how our faith is “completed” (James 2:21-22).
This is why, even though Abraham was justified by his faith, God still had to test his faith, so that his faith could be “completed” by being “justified by works (James 2:21-22) - God achieved that by commanding Abraham to sacrifice his son Isaac. Abraham obeyed God’s commandment by offering to sacrifice Isaac - thus Abraham passed the test and was “justified by works”, which “completed” his faith. commandments.
Consider Adam and Eve: After they were created, they lived in the very presence of God, but God still tested them. How did he test them? He tested them with a commandment: Thy shalt not eat from that tree. In other words, God tested them by their WORKS of obedience.
Jesus said, “If you love me, you will keep my commandments” (John 14:15) - in other words, Jesus tests our hearts and faith by our obedience to his commandments - ie, our WORKS.
Because God, being omniscient, already knew that his faith was genuine; and had counted Abraham's faith alone as being righteousness some 20-40 years before in
Genesis 15:6.
Gen 15:6 says Abraham believed the Lord, who “reckoned it to him as righteousness”. Gen 15:6 does not say, we are saved by faith alone. Faith is not the only form of righteousness - obeying God’s commandments is also righteousness. To be declared “righteousness” (justified) requires faith and obedience - ie, faith and works.
God, being omniscient, already knew that his faith was genuine
According to scripture, God did NOT know Abraham’s faith was genuine
until God tested him. After Abraham passed the test (by offering to sacrifice Isaac), God said this: “Do not lay you hand on the lad or do anything to him, for
NOW I KNOW that you fear God” (Genesis 22:12). “ In other works, God got to “KNOW” Abraham’s faith was genuine only after he tested him. So God tested Abraham’s faith because that is the only way God could know for sure what Abraham had in his heart … and that is why God tests the hearts and faith of all believers. “God tests our hearts” (1Thess 2:4).