The official Marvel site (archived) indicates that Asgard's peculiarities have not been explained:
Asgard is a small planetary body that serves as home to the Norse gods such as Thor, and their ruler, Odin. It exists in another dimensional plane and is about the size of the United States. It is not round like the Earth, does not spin on its axis, and does not revolve around the sun. It is a flat, asteroid-like mass that has a top surface with a gravitational pull, similar to that of the Earth’s, in order to keep the citizens and their cities from floating into the void. The matter on Asgard is also denser and more durable than the matter on Earth. There is an unknown force that keeps the surfaces of Asgard from eroding and from allowing its bodies of water from drifting off into space. Asgard has unknown intervals of day and night, it is unclear as to whether it uses Earth’s sun as a source of light, and there is no evidence that the seasons change.
While this does not explain the origin of the strange planetoid, it does suggest that the answer to the posed question is completely unknown.
One origin does seem to be ruled out, however. While much of the Marvel cosmology surrounding Asgard is quite true to the Norse myths, those myths had many parts of the world, including Asgard and Midgard, formed from Ymir's corpse. However, this cannot be the case in Marvel, since Ymir has been quite alive at various points in comic continuity.