I had the impression that the Earth's core started hot from the heat of a lot of inelastic collisions as the Earth formed [especially the Mars-sized one that may have created the moon], with some additional heat provided by the decay of some of the shorter lived isotopes that made up the Earth.
I don't know the reason it is still hot but one factor would have to be that two thousand miles of rock would have to have a pretty impressive R-value [as insulation]. Perhaps tidal heating from the moon deforming the earth a little bit is also a factor.
Forming opinions as we speak