The Church does recognize that divorce is not immoral if done to safeguard one’s safety, well being, or rights (Canon 1153 & Catechism 2383).
Divorce could be an appropriate means of protecting the rights of an innocent spouse and/or children in a situation where the other spouse is in jail.
However, this would not free the spouses from their marriage bond. Marriage is “for better or worse” and sometimes it is for the worse. However, rarely does someone just wake up on morning and decide to “commit a huge crime.” There is usually something under the surface that we missed about them or perhaps something they hid. In such a situation it could very well rise to the level where it had a real impact on the original consent of marriage and thus render the marriage vows invalid. If a church tribunal determines that the original marriage vows were null then both parties would be free to marry.