The important detail there is doing it without the knowledge of the (former) spouse.
You need both an insurable interest and consent of the insured in order to buy an insurance policy on someone else’s life.
Couples separating and holding policies on each other is pretty common and carriers have some specific rules to follow to make sure there’s appropriate mutual consent for policy changes etc
If they were receiving spousal support (“alimony”) or child support, this seems unsurprising and sensible.