Don't know how upscale you need your accomodations, but you can always stay at a Colegio Mayor and many of them have pools.
I spent several summers at CM San Pablo located next to the CEU. It is a little austere, but it has a lovely pool and pergola with a poolside bar. The pool never became an obsession when we knew we could go anywhere, do anything and spend our siesta on a colchoneta in the pool sipping a cold one.... Don't know if this is still an option...haven't been to Madrid in awhile.