This is what I have a question about.
Q: "Why does gravity vary with altitude?"
A: The moon and stars have a slight gravitational pull.
Q: Follow-up to previous question: How is it that the Earth does not have a gravitational pull, but stars and the moon do?
A: This argument is a non sequitur. You might as well ask, "How is it that snakes do not have legs, but dogs and cats do?" Snakes are not dogs or cats. The Earth is not a star or the moon. It doesn't follow that each must have exactly the properties of the others, and no more.
I think there should be another followup question to that one.
If the gravity of the celestial bodies is what causes the decreased apparent gravity towards earth as you increase in altitude, what's stopping the stars, moon, sun, etc from falling into each other?