Why do we have a bowel movement when we die
When a person dies, the muscles are no longer under control, including the anal sphincter muscle.
When someone dies, the body itself causes the bowel movement because the brain controls everything and when the brain fails, the body becomes incontinent and it can't hold anything.
It's amazing the things our body is doing subconsciously, and one of these things is holding it all in
Brain dead, body's still working. (Unless you were shot or stabbed or something that would harm your body)
When you die all of your muscles completely relax. So when the sphincter muscle totally relaxes there is nothing holding the feces back. Its as simple as that.