The transport secretary travelled to the country just before the decision to remove Spain from a list of nations deemed safe by officials was announced.
On Thursday the Spanish health minister reported 971 new infections of coronavirus, the biggest spike since lockdown was eased.
Mr Shapps will now be subject to his own department’s rules for foreign travel when returning from countries with high prevalence of the virus, including isolating for two weeks with the rest of his household.
A government spokesperson said of the decision to change the guidance on the country: “The Joint Biosecurity Centre together with Public Health England (PHE) have updated their coronavirus assessments of Spain based on the latest data.
“As a result, Spain has been removed from the lists of countries from which passengers arriving in England, Scotland, Wales and Northern Ireland are exempted from the need to self-isolate.
“Protecting public health is our absolute priority and we have taken this decision to limit any potential spread to the UK.
“We’ve always been clear that we would act immediately to remove a country where necessary. Both our list of quarantine exemptions and the Foreign Office travel advice are being updated to reflect these latest risk assessments.”
Questions have since been raised as to whether Mr Shapps knew of the impending change to government guidance before setting off on his trip, which coincides with the parliamentary summer recess.
Former Labour frontbencher Diane Abbott wrote on Twitter: “Various government ministers would have known in advance there was a possibility of imposing a quarantine on holidaymakers returning from Spain. But apparently no-one bothered to tell Grant Shapps.”
In April the minister attempted to warn the public off booking a summer holiday by saying he would not do so because of the trajectory of the coronavirus.
His comments, which prompted anger from tourism sector bosses, came before the number of cases began to decline in early May.
Mr Shapps told BBC Radio 4’s Today programme at the time: ”On the travel advice – should you book your holidays? – clearly people will want to see what the trajectory of this disease is in the next few weeks.
“I won’t be booking a summer holiday at this point, let’s put it that way.”