Spanish law doesn't let an employer simply divide your annual salary by 12. The Estatuto de los Trabajadores guarantees at least two extra payments a year, gratificaciones extraordinarias, one tied to Christmas and a second fixed by your convenio colectivo, most commonly July. Unless your convenio and your own agreement specifically allow prorating, your annual salary splits into 14 equal instalments rather than 12 larger ones.
The withholding quirk in bonus months comes from how AEAT retención works, not from any extra tax. Payroll projects your likely annual income based on what you're paid in that specific month, and a month carrying a paga extra shows roughly double a normal month's gross, which pushes the projected annualised figure, and the withholding percentage applied that month, higher. Your real annual liability hasn't moved at all, only the timing of when tax gets withheld.
That timing effect corrects itself automatically. Whatever gets over-withheld in July and December settles at your annual Renta return (Modelo 100), producing a refund or reducing what you owe. Look at the full year rather than any single payslip, and both the 14-payment structure and a prorated equivalent land on exactly the same net total.
Choosing between the two structures is really a budgeting preference, not a financial one. Two larger payments a year suit big, predictable annual costs; a flat monthly figure suits people who prefer their income to look the same every month. Neither leaves you better or worse off over a full tax year.