The question is based on the KJV translation. While that translation has an honorable history, it is wise to read other modern and more accurate translations before drawing final conclusions about possible contradictions in the Bible.
The NIV translates Deuteronomy 24.1-4 as follows:
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, and if after she leaves his house she becomes the wife of another man, 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, 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.
Based on this translation, the text in fact does not permit divorce. It regulates the scope of it. The idea is that in a society where divorce is prevalent, certain protections need to be in place for the good of society. The protection here is for the woman, who had no property rights in marriage and was therefore at the mercy of her husband. So Moses says that if a divorce takes place, the husband must give a certificate of divorce. In other words, she is entitled to a legal document showing her status that allows her if necessary to remarry. Then he say that if this happens again, the first husband is not allowed to remarry her. To allow this (and the fact of this regulation suggests it was actually occurring at that point in Israel's history) would be to allow men to play ping pong with a woman. She is not to be defiled in that way. In modern language, the rule here is an attempt to protect the woman against domestic abuse.
Note that this is an instance of case law. We have one short rule about divorce in the time of Moses. We don't have a full and detailed statement of legal principles about Jewish marriage at that time. (For example, we know nothing about how children were treated in such cases.) So we need to be cautious about how much we read into this single text.
When we reach the New Testament and Jesus, he is answering a slightly different question. He has been asked if it is permissible to divorce for "any reason" (Matthew 19.3). This is related to Deuteronomy 24 above, because we know from other sources that in Jesus' time there was debate over the scope of "something indecent" in verse 1. Jesus chooses to agree with the more conservative interpreters. He points to the creation story in Genesis 2. That is the first principle. Marriage is for life: one man, one woman. The Pharisees then ask him about Moses and Deuteronomy 24. Jesus continues to uphold the ideal. In effect he says that Moses was dealing with the messiness of human nature. People should commit to their spouses for life, but human sin and weakness meant that was unrealistic. Nevertheless, says Jesus, that was not God's plan "from the beginning." It's not what God wanted, and ideally it's not what we should accept.
A modern application of all this would be to say that the church should uphold the principle of life long marriage, while recognising that in a broken world this is not always achievable. So there will be cases where divorce is a reasonable option. If so, it should be applied in a way that protects the interests of all parties.