What is the purpose of the other planets in our solar system? If they were not present, how would that affect earth?
The other planets do have a (little) effect on Earth.
Jupiter, in my opinion, holds the greatest importance to Earth. The massive planet redirects asteroids and comets, disrupting their trajectory to the Sun. It prevents large asteroids from hitting Earth. Its massive gravity attracts asteroids towards it and a huge impact took place on Jupiter in 1994 when an asteroid collided.
The other planets, meaning the ones visible to our eye, help us in drawing a sky map while the ones that are barely visible, Neptune and Uranus, do not hold that much of an importance. If the other planets were not there, Earth would be a shooting zone for asteroids and the chances of asteroids hitting Earth would increase.