Here's an explanation of how this works:
All creatures are very complicated. Thus reproduction doesn't produce perfect clones, "mutations" take place. This is largely because there are so many different ways to derive one individual out of two individuals' complex genitic material. This is all a feature. This is why individuals have unique characteristics. Think about how different humans are from each other, even though we're all humans. This same thing applies to all creatures. Every individual is different. Those who have "disabilities" (disadvantages in their context) are less likely to survive. So those with advantageous traits survive and pass their traits on through reproduction, making those specific traits more prevalent.
The answer to "why didn't x evolve to do y?" is usually just that that specific mutation might have never occurred or caught on randomly. This is also why different species do different things differently. It's all random mutations. Some were beneficial in their context and environment so those who had them were more likely to survive and pass those traits along.
It's not that "the objective of life is to survive" in a spiritual sense, it's that life randomly happens and some of it survives and it makes more life like itself. In some ways, I suppose the purpose of life is to create more life. Systems that replicate themselves successfully survive. We call these "life". It's really a linguistics thing.
Hope some of this makes sense. I enjoyed thinking about this.