This biological process keeps ant colonies safe from disease, as ants will remove dead ant bodies and leave them in places where the dead ant can't contaminate others.
If you do squish an ant, quickly remove the body and then sanitize the area with vinegar, baking soda and water, or cinnamon, eliminating the scent of the pheromones.