Answer:
Because the gravitational attraction of the Sun hold them in motion around it
Step-by-step explanation:
For an object travelling in a straight path at constant velocity, the net force acting on the object must be zero.
The planets in the Solar System, however, do not experience a zero net force: in fact, the Sun exerts a gravitational attraction on them, whose magnitude is given by

where
G is the gravitational constant
M is the mass of the Sun
m is the mass of the planet
r is the average distance between the Sun and the planet
Due to the presence of this force, the Sun makes the planets 'deviating' from their straight path, forcing them to following an elliptical path around the Sun.