How can decay caused by microorganisms be both helpful and harmful?

I wrote it is helpful because if get rid of dead plants and animals.

How would it be harmful?

harmful because the bacteria might also be toxic or dangerous to other humans. This is why we bury our dead.