Rock and Ground are very distinct offensively. One covers earthquakes, spring-out-of-the-hole attacks and other stuff that propagates through the ground (Sand Attack used to be Normal); good for burying stuff, bad against something that goes "lol i just fly higher". The other is about throwing around stones, slabs of granite and other hard and heavy stuff that breaks your bones (other than icicles and ice blocks); clearly different from normal attacks (and Steel wasn't invented yet), and good for smashing and breaking squishy or fragile things like bugs and birdy bones.
So, well, there were two offensive types. And in Pokemon, a type's a type; if something exists as a form of attack, it's also supposed to exist as an element or categorisation that can be inherent to a creature, and that defines its defensive strenghts and weaknesses.
So they had to ass-pull some distinct ground-typed and rock-typed Pokemon. And while it wasn't even this hard since Rock immediately invokes images of golems, living stone creatures, and hard shells, it turned out that most of these are also (clearly) thematically connected to what Ground (as a wider archetype and a superior elemental force) was about. So there.
The Bug suffers a bit from the same situation in reverse — it's clearly in its place as a defensive type, but short of Infestation and String Shot, no attack really makes sense as being specifically "bug" element rather than normal and poison.