Divorce is never God's perfect will. Yet there are legitimate reasons for ending a marriage. Obviously, the death of a spouse is a legitimate ending to a marriage. But because of sin, certain other factors may be the moral equivalent of death. These also provide Biblical grounds for ending a marriage.
Unrepented immorality kills a marriage just as physical death does.
Complete and final desertion may also be the moral equivalent of death. Desertion leaves the abandoned partner in the position of widow or widower, deprived of marital rights. Unfaithfulness and desertion in a marriage are grounds for divorce. But neither factor makes divorce mandatory. Through repentance and understanding such marriages can be saved.