The Bible mentions several instances the gift of fertility. In Psalm 127:3-5, it was stated that children are blessing because they “are a heritage from the Lord, the fruit of the womb a reward.” And in Genesis 1:28, the Bible specifically stated that God wanted us to “Be fruitful and multiply and fill the earth and subdue it.”
However, the there is no specific instance in the Bible where it condemned those who couldn’t bear a child and it was only in 2 Samuel 6:20-23 did God cause infertility as punishment. In fact, the Bible mentioned that those who were infertile will be cured with a birth of an important character such as Isaac in Genesis 21:7, Jacob and Esau in Genesis 25:21, Samson in Judges 13, Samuel the prophet in 1 Samuel 1, and John the Baptist in Luke 1.