Posthumous divorce’s technical but less popular name is a “notification of marital relationship termination” (inzoku kankei shuryo todoke) which means one is officially severing ties with the family of a deceased spouse. What’s particularly strange about it is that it doesn’t really serve any purpose for a vast majority of people aside from a government-approved official statement that someone finds their in-laws unbearable.
I would think that it might not serve a government purpose, but it could serve a social one.
For a lot of societies, care of the elderly is supposed to be performed by the children. A marriage has the implication that care isn’t just for their own parents, but the in-laws as well. I expect a divorce like this servers that familial connection, people no longer have to care for their in-laws.
This is a HUGE deal in aging Japan, so this makes sense.