I look at it as a parallel with the teaching on divorce from old testament to new testament. Deuteronomy 24:1-4 says
24 If a man marries a woman who becomes displeasing to him because he finds something indecent about her, and he writes her a certificate of divorce, gives it to her and sends her from his house,
2 and if after she leaves his house she becomes the wife of another man,
3 and her second husband dislikes her and writes her a certificate of divorce, gives it to her and sends her from his house, or if he dies,
4 then her first husband, who divorced her, is not allowed to marry her again after she has been defiled. That would be detestable in the eyes of the Lord. Do not bring sin upon the land the Lord your God is giving you as an inheritance.
And then Matthew 19:7-9 states it thusly:
7 “Why then,” they asked, “did Moses command that a man give his wife a certificate of divorce and send her away?”
8 Jesus replied, “Moses permitted you to divorce your wives because your hearts were hard. But it was not this way from the beginning.
9 I tell you that anyone who divorces his wife, except for marital unfaithfulness, and marries another woman commits adultery.”
So it's not so much that God's idea on the subject changes, as indeed God is perfect truth, but that our nature's needed to and need to change. When in doubt, we should follow what the New Testament says, because Jesus is the Way.