Morty and Jasmine were actually never married. Jasmine’s parents are very traditional and would not have approved of her relationship with Morty because he is a dark mage (which are considered bad luck in Johto.) At this time, Jasmine still cared about what her parents thought of her, so she and Morty kept their relationship a secret. When Jasmine became pregnant with Yuusuke, her parents inevitably found out and they were not pleased. In the end, mostly due to stress caused by pressure from Jasmine’s parents, the couple broke up before Yuusuke was born. From the start, it was agreed that Morty would have custody of their son since he would likely inherit the same magic as his father. Yuusuke would still visit his mother about once a month for a weekend growing up, however.
While Jasmine tried to convince herself that breaking up with Morty was for the best, this was the main catalyst for her falling out with her parents and trying to cut them out of her life. She decided that she would live her life by her rules and not just listen to her parents when their advice went against what she wanted. Her falling for and marrying Cress (himself both a foreigner and a dark mage) wouldn’t have been possible if she had not chosen to change her relationship with her parents due to them leading to her breaking up with Morty. So, in that sense, she is a bit thankful that she broke up with him since it did help her change her life for the better in the long run. The two remain good friends despite being exes.