Take the voucher
What law applies?
Assuming you booked directly with the hotel then Spanish law applies to this contract. The hotel does not "do business" in the UK so you have no protection from UK consumer law.
If you booked through a traditional travel agent (including an online one) then your contract is with the agent and you should be sorting this out with them; not the hotel. They would be doing business in the UK and UK law would likely apply.
If you used a collation site like Expedia or Booking.com then things get complicated.
I will presume that you made the booking direct for the rest of this answer.
What does the contract say?
Subject to Spanish consumer protection law (which I have no knowledge of) the contract can deal with the hotel's inability to supply in whatever way it wants. I am not going to speculate about what it might say - you have to read it.
Force Majeure
Depending on when you booked, the cancellation due to government response may be a force majeure event which, under Spanish law, excuses the hotel from their contractual obligations.
It will almost certainly be such an event if, at the time you booked, the closure of the hotel by the pandemic was not reasonably foreseeable. So if you booked in 2019 or even January 2020 it probably wasn't foreseeable, if you booked last week it probably was and if you booked in between it may or may not have been.
If this is a force majeure event then the hotel owes you nothing - neither refund nor voucher.
Credit card protection
If there was a force majeure event then the hotel is not in breach of their contract and Section 75 of the Consumer Credit Act will not help you. It only kicks in if the retailer made a misrepresentation or breached their contract.
Take the voucher
If, when all this is over, they are still in business and you are still alive, enjoy your holiday.