The distance from the Sun alone doesn't account for the climate here on Earth.
Were it not for a natural greenhouse effect, the Earth would still be too cold to maintain life.

Without an active biosphere, all the oxygen would have been lost via oxidization, carbon dioxide levels would have risen uncontrollably without photosynthesis to regulate it and we would have lost our oceans (see Venus).

To a large extent, the prescence of Life itself is what keeps the Earth habitable.

James Lovelock makes a much more convincing argument than I can in his Gaia hypothesis, which views the Earth as a self-regulating system.

(Incidentally, an infinite Universe does not in itself guarantee Life elsewhere.
Just because an infinite can of baked beans contains a button
it does not neccessarily contain an infinite number of them.)

The unique combination of random elements that led to Life on Earth can easily be extended to the Universe as a whole, see The Anthropic Cosmological Principle.