The moon was formed approximately at the same time that Earth was formed. At that time much of the Earth was molten because of frequent collisions with other bodies which led to extreme volcanism, so was the moon.
Among the few theories which describes the moon’s formation, I think that the “double planet hypothesis” is the best, but it needs some adjustments.
The idea is that the Earth and Moon formed at about the same time in the same region of the solar system and were close enough together to form a bound system with each other is acceptable. The problem for which this theory is not accepted is because of the great difference in composition of the Earth and Moon. If they formed at about the same time in the same region of space by the same mechanisms, then they would be expected to be very similar in structure and composition. But the Earth has an average density of 5.5 gm/cm3 and the Moon has a much lower overall density, 3.34 gm/cm3, indicating that it lacks the iron core.
The densities of Mercury, Venus, and Mars are 5.4 gm/cm3, 5.24 gm/cm3, and 3.94 gm/cm3 respectively. Even the majority of meteorites have densities greater than the Moon and many are mostly iron, suggesting that a large iron content is part of the expected composition of objects formed in the Earth’s part of the solar system.
Now, in favor of this hypothesis include the fact that the Moon’s composition is very similar to material in the Earth’s mantle. Furthermore, the oxygen isotopic content of the Moon rocks is identical to that in Earth rocks and the differentiated meteorites, suggesting that it formed in the same part of the solar system.
If we look closely to the four rocky planets i.e Mercury, Venus, Earth and Mars we may notice that the two closest planets to the sun have similar densities – maybe because they are close to the sun. While the last four are gas planets – probably because they are farther from the sun. So I don’t see why Earth’s density must be different from Mars’ !
If so, than the anomaly comes Earth and not the moon. So to understand from where this excess of density comes from we must turn to Asteroids and meteorites.
In the Earth’s Late Bombardment, Earth was hit by thousands of spacial objects which were made of different properties. One of them was what Astronomers think was a collision between Earth and Theia that happened at about 4.4 to 4.45 bya; about 100 million years after the Solar System began to form.
Theia might have been made entirely of iron which brought iron to the earth’s core, either Theia or another is what changed Earth’s composition.
Personally I believe that the moon was a separate celestial body with the same properties that Earth had. Then the semi-molten Earth was struck by a giant iron asteroid which turned a life-less planet into what it is now.