It is recommended that you use cold water to wash soiled baby clothes. There are several reasons for this recommendation.
First, it is an eco-friendly way to do washing as it doesn’t require energy to heat the water.
Second, hot water set stains. If you wash a stained garment in hot water the stain will set and you’ll struggle to get rid of it.
Third, today’s detergents are formulated to clean washing in cold water.
Four, modern washing machines have an agitation motion  that is very effective at getting washing clean.