There are many centres in Spain offering both PCR and lateral flow testing. See here
https://www.unilabs.es/clinicas
here
https://static.vueling.com/corporative7/media/1274/red-puntos-covid19-mayo-2021.pdf
and here
https://www.quironprevencion.com/es/red-centros
for some of the main ones.
The types of tests which are acceptable are indicated here:
https://www.gov.uk/guidance/coronavirus-covid-19-testing-for-people-travelling-to-england
You'll see that lateral flow tests are acceptable, subject to the testing centre complying with certain guidelines. (All of those in my links should do so).
Your husband will also need to book two lateral flow tests in the UK, with one on the second day after his arrival and one on the eighth, before his departure from Spain. Approved testing providers are listed here:
https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/997884/covid-private-testing-providers-general-testing-300621.csv/preview
If your husband wishes to take a 'test to release' PCR test, which must be taken on or after the fifth day after his arrival, he will need to go to one of these approved providers:
https://www.find-travel-test-provider.service.gov.uk/test-to-release#list-of-test-providers
(Unlike the other two tests, he doesn't need to book a 'test to release' PCR test prior to his departure from Spain. If the result of a 'test to release' is negative, he can then cease self-isolating but he must still take the regular 'Day 8' test).