God's law against human sacrifice was given by Moses.
Do not give any of your children to be sacrificed to Molek, for you
must not profane the name of your God. I am the Lord (Leviticus 18:21, NIV)
Moloch (Molek) was a god worshiped by the Phoenicians and Canaanites, who sacrificed their children to Moloch by burning them on the fire.
This law was not yet known to Abraham. Therefore, when God commanded Abraham to sacrifice his son Isaac, Abraham did not quarrel with God. If this law was already given during the time of Abraham, Abraham would have rebuked God. God never go against His words. If Abraham received commands which are against God's law, Abraham would have doubted that it was from Satan. Thus, Abraham obediently followed God's order and went to mount Moriah to sacrifice his son Isaac. But, as Abraham was about to slaughter his son, God stopped him and gave a lamb as a replacement to Isaac. In fact, God does not want human sacrifice, God was only testing Abraham's faith. This story is also a metaphor of God sacrificing His one and only Son Jesus Christ for us. This story foreshadows Christ's sacrifice. Just as Abraham willingly gave his son Isaac, God gave His Son Jesus Christ for us.