The town was loyal to the crown because the rulers had done so much for them.
They appreciated the town's loyalty to the crown, but the idea never occurred to anyone, let alone the two monarchs, that Madrid might one day become the capital.