They do, we just call it an infection. All living things are under continual attack from bacteria and fungi but they are mostly able to repel these invaders through a combination of the physical barrier of their skin and the cells of the immune system that attack anything that gets inside.
If a microorganism manages to gain a foothold somewhere, cells die and the body begins to decompose. It doesn’t look quite the same as a rotting corpse because the living cells of the body are constantly battling to repair the damage. Dead things don’t resist the invaders.