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