Luke 16 is a very misrepresented chapter of the New Testament. The parable of the rich man and Lazarus (Luke 16:19-31), if it was meant as a real clarification of some immediate afterlife or an eternal afterlife for the wicked (the latter would be inherently unjust and thus irrational), would contradict numerous clear or subtle doctrines stated in the Old and New Testaments [1]. Immediately before this parable is a very brief mention of Mosaic Law and also of divorce. Luke makes his closest statement to Matthew 5:17-20, and it comes right before his declaration on divorce that, in its immediate context and in light of numerous other passages far more foundational and plain, could not condemn divorce without contradicting reason and the Bible. All relationships between ideas are governed by strict logical necessity, even if the ideas are false, so there is no way inside or outside Christianity that divorce could be sinful in itself. Contradicting reason would render Luke 16:18 outright incapable of being true.
Luke 16:16-18--"'The Law and the Prophets were proclaimed until John. Since that time, the good news of the kingdom of God is being preached, and everyone is forcing their way into it. It is easier for heaven and earth to disappear than for the least stroke of a pen to drop out of the Law. Anyone who divorces his wife and marries another woman commits adultery, and the man who marries a divorced woman commits adultery.'"
As sometimes happens when people talk about language, Jesus uses words that speak of language itself standing in for the concepts the writing or speech is assigned to. The strokes of a pen refer to the moral obligations that, if the Torah is true, obviously are not just words on a physical material. The concepts are what matters. What Jesus would be communicating, unless he is philosophically conflating written symbols with actual moral obligations and other abstract concepts, is the enduring nature of morality as described in the Law. I will focus on what a mere selection of the relevant verses in Mosaic Law obviously prescribe or permit regarding divorce, the topic of Luke 16:18.
Still, note that Jesus, even in this statement that seemingly contradicts so much of the Bible and makes him an obvious heretic if it meant what many pretend, does not say to never divorce; Matthew 19:9 records him as providing a justification for divorcing over sexual immorality regardless, and even this is in turn extreme and all but misleading hyperbole or heresy against the religion of Yahweh he claimed to affirm. In the most literal sense, his words in Luke 16:18 only say that divorcing someone and marrying a new partner afterward is adultery. Divorce is still not itself condemned, whatever the reason. The irony is that whatever the New Testament says, it is only the Law from God, which both plainly (Exodus 21:10-11, Deuteronomy 21:10-14, 24:1-4) and sometimes less directly (Exodus 21:26-27, Leviticus 22:14, Deuteronomy 4:2) allows divorce for both genders and for many reasons, that holistically reveals the Biblical morality of divorce, and remarriage is clearly nonsinful according to Deuteronomy 24:1-4 (and 4:2, a verse relevant to many subjects).
See also, before I elaborate on some allowances for divorce in Mosaic Law, what Malachi says about whether God's nature that grounds morality changes:
Malachi 3:6--"'I the Lord do not change.'"
James 1:17 only echoes this in the New Testament, not that the New Testament would ever be correct in a matter it contradicted the Old Testament on. If Jesus is not using words in a completely unconventional manner (since their exact meaning is determined by the speaker's intent and ultimately nothing else), either Jesus is massively exaggerating about divorce and remarriage for psychological/rhetorical impact or he is an irrationalist who thinks contradictions can be true--and also a heretic that thinks Yahweh's righteous laws are evil or that Yahweh's moral nature changed. He would also both contradict and heretically reject his own philosophy of Mosaic Law articulated just two verses prior to Luke 16:18! I have already mentioned verses in this post from the Torah that certainly permit or indirectly require divorce.
I will show one of the more subtle but still highly relevant passages, Exodus 21:26-27, to emphasize how even some less directly connected verses very much clarify the freedom and moral right to divorce in many circumstances. I have placed Deuteronomy 15:16-17 before Exodus 21:26-27 in the arrangement below to highlight the parallels between Biblical slavery and marriage even further. With or without Deuteronomy 15:16-17 (see also Exodus 21:5-6), Exodus 21:26-27 absolutely allows divorce for something that has nothing to do with adultery or broader sexual immorality:
Deuteronomy 15:16-17--"But if your servant says to you, 'I do not want to leave you,' because he loves you and your family and is well off with you, then take an awl and push it through his earlobe into the door, and he will become your servant for life. Do the same for your female servant."
Exodus 21:26-27--"'An owner who hits a male or female slave in the eye and destroys it must let the slave go free to compensate for the eye. And an owner who knocks out the tooth of a male or female slave must let the slave go free to compensate for the tooth.'"
A male or female slave must go free, save for optional mercy on the victim's part, for abuse. So too should husbands and wives. The fact that Deuteronomy 15:16-17 speaks of male and female slaves eagerly, lovingly pledging themself to serve a master or mistress for life rather than automatically going free in the seventh year (Deuteronomy 15:12) only makes the overlap more extensive. Abuse entitles a slave to leave even if they had promised lifelong commitment, and marriage is no different in these regards. Exodus 21:26-27 and Deuteronomy 15:12-18 do not mention divorce at all, but they have crucial and logically necessary ramifications for it. This is aside from the passages in the Torah that do allow it for other specific reasons, ultimately for any sin at all (Deuteronomy 24:1-4).
For another unstated yet logically necessary justification for divorce, look at any of the capital punishment laws. If death or morally permissible divorce ends a marriage before God, then anyone who commits a capital sin, in forfeiting their right to live out the rest of their lifetime, forfeits their marriage. None of the capital punishment passages touch on divorce, but it follows whether someone likes it or not that divorcing a capital sinner of any sort is both not condemned and allowed by virtue of what capital punishment is. The marriage will or at least should end one way or another! Also, adultery, as a capital sin (Leviticus 20:10 and Deuteronomy 22:22), deserves death, so it also cannot be true that it is Biblically the one justification for divorce (or one of two; 1 Corinthians 7:15) from this alone. Examples like the following also entitle someone to end a marriage:
Exodus 21:14--"'But if anyone schemes and kills someone deliberately, that person is to be taken from my altar and put to death.'"
Leviticus 20:27--"'"A man or woman among you who is a medium or spiritist must be put to death. You are to stone them; their blood will be on their own heads."'"
Concerning murder, the sin would have to be carried out against someone outside the marriage for a spouse to be alive to divorce anyway, but for many reasons the sin does not have to be directed at the spouse. Capital sins already warrant divorce by nature in the absence of a conflicting or superceding obligation taught by the Law, and all sins, against anyone, are basis for divorce if a spouse is displeased enough (Deuteronomy 24:1). Indeed, if the Torah never once provided specific examples of divorce or divorce-adjacent things being permissible (or required in Exodus 21:26-27), the lack of prohibition concerning divorcing a spouse for his/her moral errors would on its own mean it is not Biblically sinful to do so. This is independent of the Law's specific acknowledgment of divorce without general condemnation in verses like Leviticus 22:13. By nature, wherever the line is for morally required and evil things, it would not be necessary to go above and beyond in order to be righteous, by pursuing optional good or avoiding things which are not evil.
Something being obligatory, permissible, or evil does not change based on region or time if all people are capable of carrying it out or avoiding it respectively. Men and women of any era and place have the metaphysical capacity to divorce and be divorced, whereas abstaining from fruit grown in the first three years of living in the Promised Land (Leviticus 19:23-25) does have geographical and time-bound applicability. Thus, logically, if morality exists, divorce is not good, optional, or wicked based upon such factors. The Bible, which can still only be illuminated by looking to reason, absolutely allows for all spouses to divorce for a great many reasons beyond adultery and to marry new partners. Luke 16:16-17 in truth teaches the Law is still entirely binding (with necessary exceptions like the case of the aforementioned fruit trees of the Promised Land) since it aligns with objective morality. Like with Matthew 5:31-32 and 19:9, consequently, Luke 16:18 either proclaims sharp hyperbole or utter stupidity and heresy on many levels.