Because of gravity. the sun did. Gravity is a force that pushs you down and you resist with your gravitaional force but earths gravity is stronger.
How come we don float into Space? Who said that? Ok but what is gravity ?
Gravity, or gravitation, is a natural phenomenon by which all things with mass or energy—including planets, stars, galaxies, and even light—are brought toward one another. On Earth, gravity gives weight to physical objects, and the Moon's gravity causes the ocean tides.