In this story the Earth has been contaminated with radioactivity in the aftermath of a nuclear holocaust. For the story line to be plausible, some explanation of how the colony survived annihilation must be pro-offered. Having them already in space equipped with the basics for survival seems to be the most obvious way to go about it.
Another reason for the Earth to be seen from space is related to the title itself. "If I Forget Thee, O Earth" comes from a Biblical passage related the mourning of the Israelites when held in captivity in Babylon. In it the chief singer laments their ancient homeland, saying that a curse will fall upon anyone who forgets his native land. The same goes for Marvin and the inhabitants of the space colony, destined to never return to Earth themselves but harbouring the hope that one day their descendents will indeed reclaim it.
The setting of the moon offers a stark contrast to the biodiversity of the Earth as we presently know it. The bleakness and sterility of it are an appropriate background for the cautionary tale Clarke develops, intrinsically related to the theme of the story, which of course concerns the conservation of the planet. See the reference below for further information about this.
Arthur C. Clarke elaborated another story along the same idea in his 'The Songs of Distant Earth.' In it the planet itself has been destroyed but spacecraft called "seed ships" have been sent out in different directions throughout space in the endeavor to preserve life and propagated it elsewhere.