Because only Imu has the power to erase islands and:
- Imu rarely takes action
- Hence no one knows of their existence
- If islands were frequently erased from history, people would know that the World Government has that power, but that's not currently believed to be the case
- The Gorosei cannot ask Imu for help
- They worship and praise her, they don't tell her what to do
- Imu does not work for the World Government
- They rule over the world from the shadows
Imu is like the Soul King in Bleach, only a secret one.
Besides, it's likely that Rocks was actually killed by Imu. It's said that Rocks wanted to be the King of the World. Imu may have erased him only because he dared for her throne.
Well, it was still Roger and Garp who faced Rocks, Imu only erased the remains, without actually harming any of the Yonko, Roger or Shiki. And given the Grand Line is a harsh environment with all kinds of crazy phenomena, releasing such attacks here and there wouldn't be an anomaly.
Apart from that, iirc, the void century exists because the WG in the past did some grand cleansing, so they are willing to do so if shit gets serious. And now, we have the age of piracy at their peak, with Joyboy awakened, with Blackbeard as an anti-Luffy, shortly prior to that Kaido teaming up with Big Mom and wanting to aim for the ancient weapons and throwing the world into chaos, while occupying the most important country tied to the void history which hosts an ancient weapon.
You say that Imu rarely takes action but wants to set example by just erasing a rebellious fodder country, when that country's influence is nothing compared to Kaido, who just declared war against the world, having huge military might and individual power.
I have yet to see a reasonable explanation to the pattern Imu uses and why he wouldn't just erase the Yonko 1 by 1, have the Road Poneglyp's confiscated. Because again: the void century proves that Imu and the WG are willing for a great cleansing. Yet, what they do now, is crying and bitching around.