What has Spain to gain be making this announcement now? There's the precious income Spain gains from all those Brit pensioners, but more than that, a cynic might suggest Spain is intent on currying favour with the international community on the threshold of what it is about to do in Catalonia. A bit unsettling.
Spain stood beside the UK during the Scottish referendum, and repeatedly said they would not veto Scotlands membership of the EU or EuroZone as an independant country, citing that this would only encourage Catalan unrest - I would imagine that they now want reciprocal support from the UK with respect to any potential application from the Catalan government. The UK could possibly profit from this alliance in the Brexit negotiations.