The simplest answer to this question is “to test their faith”. God had personally made a promise to Abraham that he and Sarah would have a very special son, through whom the entire world would receive blessings. Genesis 17:19, “And God said, Sarah thy wife shall bear thee a son indeed; and thou shalt call his name Isaac: and I will establish my covenant with him for an everlasting covenant, and with his seed after him.” Even though the fulfillment of that promise seemed to be delayed, Abraham and Sarah needed to trust God more. Faith is essential to any relationship with God. “Without faith it is impossible to please God,” Hebrews 11:6 (NIV). God will definitely keep His promises. “For the gifts and the calling of God are irrevocable,” Romans 11:29 (NASB). God had a timeline that involved Abraham and Sarah fully trusting in Him rather than relying on the normal course of human possibilities.
There is a deeper answer to this question. Abraham’s life was an allegory of the development of the Christ (head and body) who will be the spiritual ‘sons of promise.’ Faithful Christians will ultimately be partners with Jesus in blessing all the families of the Earth. Galatians 4: 22- 31 (NIV): “For it is written that Abraham had two sons, one by the slave woman (Hagar) and the other by the free woman (Sarah). His son by the slave woman was born according to the flesh, but his son by the free woman was born as the result of a divine promise. These things are being taken figuratively: The women represent two covenants. One covenant is from Mount Sinai (the Law Covenant) and bears children who are to be slaves: This is Hagar…But the (New) Jerusalem that is above is free, and she is our mother….Now you, brothers and sisters, like Isaac, are children of promise. At that time the son born according to the flesh persecuted the son born by the power of the Spirit. It is the same now. But what does Scripture say? ‘Get rid of the slave woman and her son, for the slave woman’s son will never share in the (heavenly) inheritance with the free woman’s son.’” Therefore, brothers and sisters, we are not children of the slave woman, but of the free woman.”
Abraham and Sarah waited for many years before Isaac was born. Correspondingly, many years passed before the arrival of the spiritual promised seed: Jesus and the church. The human race is also waiting for the promised seed. “For the creation waits with eager longing for the revealing of the sons of God,” Romans 8:19. It is this seed which will ultimately deliver the entire human race out of slavery to sin into “the glorious liberty of the sons of God.” Romans 8:21.