Sure a lizard losing it's tail as a defence doesn't kill the lizard, but it still causes it harm and stress, quite apart from all the extra food it needs to find to re-build the tail.
Or think of it in human terms.
The human reaction to danger is the 'fight or flight' response. Our body is flooded with a hormone called adreneline which raises blood pressure, increases heart rate, causes the bowels to stop digesting food, releases the bladder, causes tunnel vision, starts the sweat function and dries the mouth
All these affects are designed to allow the human the fastest getaway with all resources going into fleeing, and so avoiding death..... but if this is kept up for any length of time, even at low levels it causes strain on the heart & myocardial infarction, psychotic episodes, embolisms, stomach ulcers, strokes and a host of circulatory issues.
People die of stress...eventually
So to conclude, animal defenses are a short term emergency thing with long term concequences. The body doesn't care if the defence mechanism eventually kills the animal, just as long as the animal survives long enough to pass on its genes to the next generation.