You have misunderstood.
The parents' dates and places of birth and nationalities and grandparents' names are on the birth certificate, obviously.
But instead of saying Father - John, Mother - Lucy they say Progenitor A - John, Progenitor B - Lucy. Or Progenitor A -John Progenitor B - Diego or Progenitor A - Maria Progenitor B - Lucy. So there is no issue for trans people or same sex partners.
Also Spanish kids have both parents' surnames, always.