Earth's Core Was Created to Protect Life
Our planet was created for life.
A smaller planet, like Mars, would be unable to hold our atmosphere, which protects us from meteoroids and keeps the temperature within the range needed for life.
A larger planet, like Neptune, would trap too much atmosphere. The pressure and temperature would greatly increase. A stronger gravity from the increased size would also trap harmful gases in the atmosphere.
Earth has a strong magnetic field. This protects us from harmful radiation from the sun.