The most logical explanation is because they formed closer to the solar nebula. Only Jupiter has a cloud top gravity that is stronger than Earth's, the rest are comparable to Earth's which weakens any argument in favor of their gravity being the simple cause.
jupiter
The gas planets have more moons. Of all the gas planets non has fewer than 14 moons. Of the rocky planets, none has more than two. Mercury and Venus have none at all.
gas planets
The gas giants have more moons than the inner rockey planets, since they are a lot more massive and are in a region of space where more moons can be captured.
None of the gas planets in our solar system do. All of their moons are rocky or icy objects.
They are larger and so they have more gravity.
The gas planets are much more massive than the terrestrial planets and therefore have stronger gravity. It is believed that as they formed many of their moons formed around them much like the planets formed around the sun. Other moons are likely captured asteroids and comets.
All of our Solar Systems gas giants have more moons than the terrestrial planets. Jupiter (63), Saturn (62), Uranus (27) and Neptune (13).
They are larger and so they have more gravity.
They are larger and so they have more gravity.
The total number of moons owned by the terrestrial planets is three, and that's a stretch, as one of Mar's moons is almost certainly a captured asteroid. The gas planets have scores of moons among them, mostly because they are much larger, hence have much greater gravity, and attract more moons among them.
Gas giants have a higher mass. This means that the gas giants have a more gravity to hold moons in orbit around them.