Who on ____ could have done it?
I feel either can be used. The emphasis of the statement is a common ground (how apt) between all of humanity. We all live on Earth, and to (I suppose) a lesser, yet still great, extent we all live on soil/ground/earth aswell.
we all know that EARTH is the only planet with living creatures....it is unique..nothing can replace it.In my perspective it should always be indicated with upper case letters...
I like the AP style rule that Earth with a capital E is reserved for reference to the planet in the solar system. Earth with a lower-case e belongs in idioms, such as "Who on earth ...?" and "What on earth?"