There's actually a lot of water in the mantle of the Earth. There's something like 3x the current ocean volume trapped in the mantle, and there are theories that pressure differentials cause this water to escape as gaseous water escapes from the atmosphere. It would explain why the ocean happens to be approximately the height of the continental shelf, and always has been. Under this theory the water simply emerged as the Earth cooled from the impact. The Moon, on the other hand, would be missing this water as the debris was mostly stripped of water content as it accreted.