The law in Spain regarding drivers who wear glasses has been modified.
As you can read in the link attached below, the DGT published a book called “Consejos y Normas de Seguridad” to give drivers some advice. In point 5.4 it states the following:
“Si utiliza gafas graduadas es aconsejable (advisable) llevar unas de repuesto. “
So it is not compulsory to carry a spare pair in your car, but remember that you must wear glasses if you need them all the time. Therefore you cannot be fined for not carrying spare glasses, but you could be fined if your glasses are broken and you are driving without them.
For this reason the DGT says that it is advisable to carry a spare pair.