God did this so that he could buy the freedom of those who were under the law. God’s purpose was to make us his children.