Indeed, AFAIK. I've never seen an explanation for this. Most things that reproduce successfully want to do it again - or at least their DNA does. Perhaps octopuses are simply disappointed by the experience.
For the mothers, the entire time is spent cleaning and blowing water over the eggs.
It’s generally accepted this behavior is the necessary pair to their high aggression and cannibalism. It’s likely if they didn’t go through this they’d end up eating their babies. By dying, they make way for a new generation. And this is their reproductive strategy. Live a short very active life. If you survive, mate, then die and leave the hunting grounds to the next generation.
But not whether other adaptations could be possible. Fix the digestive tract issue and keep the female well fed and defending the nest in a different way