Why only structures corresponding to valleys on PES are taken into account?
The vast majority of thermodynamics we consider is at equilibrium, we is the issue here.

At equilibrium we will only find our S states at the bottom of the valleys (or minima) populated.  This this because they have now force acting on them to drive them to another configuration.

An important relationship to remember with potential energy surfaces is:
$$
F = -\frac{dE}{dx}
$$
Force is the negative derivative of potential energy with respect to some coordinate.
This means that the driving force is given by the slope of the PES and is pushing down the PES.
Then a molecule with a $\phi = 150^\circ$ experiences a rotational force pushing it towards the minimum at $\phi = 180^\circ$.

Answer:

The result is that any molecule not at a minimum will be quickly driven towards the nearest minimum, so only the minima will be occupied and need to be summed over.

Side Note - Maxima

Maxima (the peaks) also experience zero force.  However this is only true at the exact peak itself.  Any point infinitesimally far away from the maxima experiences a force pushing it down the hill into a minima.

Thermal fluctuations and collisions with other molecules will continually slightly nudge the molecules around on the potential energy surface.  At maxima this will push any molecules there off the peaks and down into minima.  In minima, the force will bring the molecules back into the minima.