Because of the Hardness of Hearts

How can Israel be the children of God and have done such horrible things? Things that God allowed with ancient Israel. How can we explain some of these less than perfect social customs that existed in ancient Israel?