Isn't it unsanitary to leave baby poop stains on your clothes and then put them in the washing machine?

If you put an appropriate amount of detergent into the washing machine and rinse it at least twice, the waste water will physically flow down the drain, so I think it's more hygienic than washing by hand.

If you are concerned about hygiene, you can simply remove the cloth diaper from the soaking water and put it in the washing machine.