I imagine they film in the low season. I have been on plenty of holidays when it's sunny but nobody is using the pool. Many show cloudy skies and the odd spot of rain.
These are also residential places, less tourist places.
Agree with the responses above. My experience is that in addition some communal pools in residential complexes forbid swimming in the afternoon during the siesta time.