Well, when I take my bike to my parents it's what I have to do since they live on a cul de sac on a hill.
For spin class, I guess you can do whatever you want.
I am wondering how religiously this cooldown thing needs to be done anyway.
But you can always be cheeky and tell him.
Like when our substitute said before the class "we're going around the lake" in 90 min (equivalent to a killer average of 45km/h !!) and - surprise - that "around the lake" contained one hill after the other.... You are allowed to challenge your instructor, no?