I'm not 100% sure but I think it's because as the star contracts the P.E of the particle's decreases and their K.E increases, since K.E is proportional to T, the temp rises. The reason the temperature is sooo high is because there is a huge collapse as a star becomes a white dwarf hence there is a huge decrease in P.E of the particles hence a huge increase in K.E and also temperature.