They recently amended the law, it now says in art 17 para 3:
El pago se efectuará a través de medios electrónicos. Excepcionalmente, cuando alguna de las partes carezca de cuenta bancaria o acceso a medios electrónicos de pago y a solicitud de esta, se podrá efectuar en metálico y en la vivienda arrendada.
My translation:
The payment [of the rent] will be done by electronic means. Exceptionally, when one party doesn't have a bank account or access to the electronic means of payment, and at a request of said party, it will be allowed to make the payment in cash and on the leased property [means the parties should meet there].
Funny thing: any bitcoin or cryptocurrency should do. CoinJoin? PayJoin? Lightning through blinded route? Monero? All those should be ok, cannot argue that Bitcoin is not "electronic". The law says nothing about KYCed custodial account or traceability. Ironically, this law probably intends to tackle theft evasion (aka "tax evasion" in statespeak) - they want to make the landlord's income more visible.
Context: In Soviet Spain, it is already prohibited to pay more than 1000 euros in cash, with exceptions for foreigners or banks. So this is an additional restriction. Cannot pay rent in cash (even if it is 1 euro), and cannot pay 1000 eur in cash for anything.
Less funny thing: Can I pay rent by cash deposit in a bank? It is mostly done at bank's ATM, and an ATM is quite electronic. It even fulfills the probable intention of the law, as the recipient (landlord) is still identified. I started doing it recently, mostly out of spite.
Because of this idiotic formulation - what is "electronic" - I am thinking about writing the ombudsman, to file a complaint before the Constitutional Court, to strike the law down for vagueness. But not holding my breath.