My textbook says that the plum pudding model(Thomson's model) should be electrostatically unstable. Why is that so?
No system can be electrostatically stable. As Wikipedia explains,
Earnshaw’s theorem states that a collection of point charges cannot be maintained in a stable stationary equilibrium configuration solely by the electrostatic interaction of the charges.
It can be understood intuitively as a consequence that electrostatic fields are divergenceless.
For a particle to be in a stable equilibrium, small perturbations ("pushes") on the particle in any direction should not break the equilibrium; the particle should "fall back" to its previous position. This means that the force field lines around the particle's equilibrium position should all point inwards, towards that position. If all of the surrounding field lines point towards the equilibrium point, then the divergence of the field at that point must be negative (i.e. that point acts as a sink). However, Gauss's law says that the divergence of any possible electric force field is zero in free space.
Your textbook is wrong. Earnshaw's theorem does not apply to the plum pudding model: the pudding provides a non-zero divergence.
Actually Thomson was aware of the possible problem of stability, and this was one of the reasons for his choice of the model. In his 1904 paper, he was able to show that, for an increasing number of negative point-like "plums" embedded in a spherical uniform positive charge, regular shapes in the form of rings, or rings with a center, are stable equilibrium configurations. He considered not only rings but also three-dimensional shells of particles at regular positions, arriving to propose a connection between such static shell structures and some properties of the periodic table, anticipating, in a sense, the correct explanation of periodicity of atomic properties.
It is also worth of notice that the analysis of scattering of alpha particles on gold thin foils, performed by Rutherford in 1909, arrived as a shock, since it falsified Thomson's model with its stability, and forced to assume the planetary model, evidently unstable, due to radiation. Without recognizing the stability of Thomson's model, such a key step in the history of atomic model would not be understandable.
A final note is that Thomson's model had a recent resurrection in connection with the theoretical analysis of quantum dots. You may find some reference to this application in the wikipedia page on the model.