Compulsory motor insurance in Spain is set out in Royal Legislative Decree 8/2004 on civil liability and insurance for motor vehicles, published in the official state gazette (BOE).
For a car registered in Germany, the German compulsory liability insurance covers you in Spain. Spain is part of the Green Card Multilateral Agreement, so the German plate serves as proof of insurance.