A trait that helps early in life can still shorten life later
Natural selection can favor a trait that helps an animal survive or reproduce when it is young even if the same trait causes problems later. From evolution's point of view, the early advantage can outweigh the later cost.