Why is the Earth so perfect for life? Or even more broadly, why is the Universe so perfect for life?

Well, if it wasn't, there would be no life in it, and therefore no one to ask the question 'Why is the Universe so perfect for life?'.

So goes the anthropic principle.