...but there's something else which also has to be "just right" - a planet's electric field.
Earth has a natural electric field - it's caused by a potential gradient in the atmosphere - the earth is negative and the ionosphere is positive. This is, of course, what causes thunderstorms. Lightning actually triggers complex molecules, so a lifebearing planet needs thunderstorms. Lightning plays a role in nitrogen fixation.
Mars - may have. Dust storms produce static, which produces lightning - but Martian lightning tends to stay in the dust storms and not produce thunderbolts, keeping that energy in the atmosphere. It's likely that Mars does not have enough electric generation to help support life - but we don't really know until we get a rover down there with the right instruments on it.
Venus? Venus has way, way too much electricity. Earth has a tiny amount of charge in the ionosphere. Venus has so much that it's stripped the water from the planet. It actually has a true electric wind, akin to the solar wind.
If Mars has a very high electric charge too, then it may explain what happened to the atmosphere. But what if it turns out to be very low and that is the problem?
Do we have to look, in addition to the right temperature, for the right amount of electricity?