Why is the earth's interior made up of hot molten rocks?
While it is apparent from volcanism that at least some of the Earth's interior is made of molten rock, evidence suggests that the degree to which it is molten changes, and some of it may not be molten at all. For example, research based on measuring the pressure waves generated by earthquakes suggests that the Earth's core is solid iron.
Probably the most significant reason for the earth's interior having any molten rock, particularly at this point in its lifetime, is because it has a relatively high amount of radioactive material. As radioactive material decays, it releases both particles and energy which can transmit heat which was once bound in the nuclei. This is the same reason that nuclear power plants require extensive cooling systems.
Another reason is that the crust and atmosphere act as shields, covering the interior of the earth like the crust on a pie, and helping the Earth to retain "primordial heat" - the heat left over from the formation of the Earth and solar system.
It should also be considered that, because the majority of space is empty, there is simply nothing there for matter to interact with and transfer heat to; plus, the atmosphere is very thin in the upper layers, so the actual emission of heat must take place either very slowly, or via photons and other non-massive particles.