A spacer is used when a baby tooth is lost early due to decay or injury. It prevents the other teeth from moving into the vacant tooth area over time.