Being a citizen or documented resident of Andorra also is grounds for exemption to the Spanish ban that hits people from the UK.
I am wondering if being a Portuguese citizen is also grounds for an exemption to the Spanish restriction applicable to transit too, especially since Portugal and Spain coordinated on deciding to restrict travel from the UK. A sizable minority of UK residents of Indian origin are Portuguese citizens, so I guess they could transit LIS if MAD is off limits.