Yes, sterilizing soil with high heat or chemicals will kill earthworms and other beneficial organisms. Consider solarizing, lower heat methods, or waiting to plant seedlings until the soil has cooled to preserve earthworms, as they aerate soil and aid water retention and nutrient cycling.