Why would an orbiting electron lose energy? Ernest Rutherford proposed that the electrons were orbiting around the nucleus just like planets orbiting around the sun. However, this simple picture defied the laws of physics. Electrons revolving around the nucleus would lose energy and spiral into the nucleus, i.e. the atom would collapse.
The above is a passage from my physics textbook.
Planets don't lose energy and spiral into the sun. Why did scientists feel that revolving electrons would ? I mean the electrons would be in a vacuum so why could they not just orbit forever ?
 A: From Maxwell's Equations of Electromagnetism, we know that accelerated charges emit electromagnetic radiation. It can be shown (see here) that the total power radiated by such a charge accelerating with some acceleration $a$ is given by the Larmor formula:
$$P = \frac{1}{4\pi\epsilon_0}\frac{2 e^2}{3 c^3}a^2.$$
Classical electrons are considered to be charged particles executing some form of circular motion, and by definition are thus accelerating. It can be shown using the above formula and some elementary physics (see my answer to this question: Why Rutherford model of atom is unsatisfactory: quantitative estimates) that the time taken by the electron to radiate all its energy would be of the order of $\sim 10^{-11}$s. Keep in mind that it's not just that the fact that the electron would radiate that's strictly a problem: if (by some lucky chance) we had found that the constants of Nature meant that it would take $10^{40}$ years for the electron to lose all its energy, we wouldn't be too worried. It was the fact that it took such a short time, meaning that no atom could ever be stable, that was worrying.
Thus it seemed like the two ideas: the revolving electron and Larmor's formula could not both be true simultaneously. Larmor's formula followed directly from Maxwell's Equations (Purcell has a beautiful derivation of it at the end of his book, Schroeder has a "simplified" version here), so rejecting it would have meant rejecting most of Electromagnetism, so it was much more likely that the Rutherford model was not true.
As to why scientists did not feel that the same thing would apply to planets, I'm not completely qualified to answer, but it seems to me that accelerated masses have no such restriction in Newtonian gravity. In this theory gravity was an "action at a distance" force: if a mass changed its position, the entire gravitational field throughout the universe changed instantaneously, and the resultant gravitational forces were instantly changed accordingly. The changes do not move as waves, as in the case of Electromagnetism.
I'm not an expert, but it seems to me that when we move to General Relativity to describe gravity, such "accelerated masses" do indeed produce gravitational radiation in the form of Gravitational Waves. Note however that unlike the electromagnetic case, acceleration is a necessary but not sufficient condition for such gravitational radiation to be emitted. However I do not know if this was known at the time, and it's quite likely that the amount of radiation would be much smaller than the electromagnetic counterpart!
A: Let us answer your questions from the end.

Planets don't lose energy and spiral into the sun.

An electron - orbiting the sun like a planet - follows the so called geodesic path. This path is the one on which no force is exerted on the particle. Floating together with the electron around the earth you will not feel any acceleration. That is the reason why Einstein talked about the curvature of space around masses and not about the gravity as a force.$^*$$^)$
=> Following the curved space (the geodesic path) an electron does not feel any acceleration and do not radiate.

Ernest Rutherford proposed that the electrons were orbiting around the nucleus just like planets orbiting around the sun.

That was a proposal for lack of a better idea. According Rutherfords experiments the atom has a nucleus, concentrated in a very small center of the atom and electrons which do not scatter the helium nuclei (alpha particles). The volume between the nuclei offered no resistance to the alpha particles. Rutherford concluded that the electrons are point-like particles and only the revolution around the nucleus would prevent them - in analogy to the planets around the sun - to fall into the nucleus.

However, this simple picture defied the laws of physics... Why would an orbiting electron lose energy?

An electron never changes its direction without reason. Either an electric field influences the electron (the positive charged nucleus attract the negatively charged electron), or a magnetic field interacts with a moving electron. The last is called the Lorentz force (in the original sense, the electric part was added later).
It is important to note that cause and effect of the Lorentz force are the following. A magnetic field - interacting with the magnetic dipole of the electron - changes the orientation of this magnetic dipole of the electron and the gyroscopic effect moves the electron sideways by the emission of photons. Not having the external magnetic field an electron would not be moved sideways. Rutherford's idea lacked any foundation. That was a proposal for lack of a better idea.

$^*$$^)$ Imagine that you are at the distance of Pluto from the sun, but not orbiting the sun. You will remain there until you realize that you are approaching the sun after all. You will not feel any acceleration until you hit the sun (apart from the heat), you will remain weightless, without any acceleration. If you were blindfolded, you would not be able to tell whether you were moving forward or standing still.
