Planetary movements have a strong effect on all living beings. During eclipses, the energy providers in the universe are blocked out. Temples are built to attract astral energy & positively charge the devotees; the positive effects will be reversed during the solar eclipse.
It is also thought that, deities in temples, which have been consecrated by mantras and rituals, have an external energy field around the form, which combined pull of the sun and moon during the installation can weaken during the eclipse, is the other way of thought.
Hence, to let devotees stay away from negative energies, temples are closed during eclipses. They re-open as soon as they eclipse is done.