From November 23rd, 2020, all passengers who come from a high-risk country/area in relation to SARS-CoV-2 coronavirus, must present, in order to enter Spain, a certificate with a NEGATIVE PCR result (COVID-19 RT-PCR), carried out in the 72 hours before arrival.
This certificate or supporting document must be the original, must be written in Spanish and/or English and may be presented in paper or electronic format. The document will contain, at least, the following information: traveller's name, passport or ID number, test date, identification and contact details of the centre that performs the analysis, the used technique and a negative test result. The personal identification number (passport/ID number) that you use to get your QR code must be the same as the identification number that appears on the negative PCR certificate.
Please find out more about this regulation and list of high risk countries at:
https://www.mscbs.gob.es/en/profesionales/saludPublica/ccayes/alertasActual/nCov/spth.htm
Spanish authorities request as well to fill out a Health Control Form that would be requested at the airport control.