Spain has a church tax, however, it is voluntary and does not depend upon church membership. This makes church-leaving in Spain a purely religions, rather than a political act. Furthermore, Spain's Information Protection Law does not apply to baptismal records, thus making it impossible to officially register the desire to leave the Church.
Under Spain's Information Protection Law, Spanish citizens have the right to remove personal information from public records, but in 2008 Spain's Supreme Court ruled that this does not apply to baptismal records.  The Court said that baptismal records are not covered by Spain's data protection law because they're not strictly speaking data, but rather a “pure accumulation” of information, which is “organised neither alphabetically nor by [birth] date” making “access, identification and searching difficult”.  In 2011 an appeal to the Constitutional Court upheld this, but only on a technicality, saying that the Data Protection Agency was not the right body to launch a court case.  This does not prevent someone else from taking the matter before the courts.
For now, at least, the Spanish Therefore in Spain the Church continues to decide who is allowed to leave it and when. It requires the applicant to supply a birth certificate and a declaration of abandonment of faith, and it can take as long as it wishes to honour the request, if indeed, it wishes to do so at all.  And due to the court decisions, those who have left the Church cannot insist on an annotation in the baptismal register that they no longer wish to be members.
Claimed as a concordat privilege
A Spanish Cardinal also points out that the 1979 concordat on legal affairs guarantees the “inviolability” of Church records. Valencia Cardinal Garcia-Gasco appealed a lower-court ruling in 2007 that Spanish citizens have a right to remove their names from church baptismal records. Lawyers for the diocese argued that baptismal books do not purport to reflect current membership in the Catholic Church. In addition, they said, the Spanish Data Protection Agency's demand for the removal of names violated a concordat with the Vatican. Article I.6 of the 1979 Concordat on legal affairs begins “The state shall respect and protect the inviolability of archives, registers and other documents....” 
This is not the first time the Spanish Church has cited this useful clause. Back in 2001 the Archbishop of Valladolid used it to deny the judge access to financial records connected with the Gescartera corruption scandal. 
Opus Dei must delete data of ex-member
However, even an appeal to the concordat did not keep the Spanish Supreme Court from ruling in 2011 that Opus Dei must remove from its records all the personal data of an ex-member. The Court ruled that Opus Dei had organised the data to the point where they were easy to locate, thus making them unlike baptismal records which merely accumulate. It also ordered Opus Dei to pay €3000 for the lawyer's fees and court costs of the ex-member. 
How to (try to) leave the Spanish Catholic Church
Although the Catholic Church in Spain is not legally obliged to honour a request to leave it, instructions are available for making the attempt: "Models for a letter of apostasy and steps to follow". Included here is a form declaring your wish to leave the Church to send to your Diocese/ Bishopric/ Archbishopric.
1. "Apostar ¿misión imposible? ¿Es que no puedo dejar de ser católico? " Heraldo, [19 October 2008]
This reversed a lower-court decision: Graham Keeley, "Court clears way for baptismal annulment", The Tablet, 27 October 2007. http://www.thetablet.co.uk/article/10546
2. "Spain's Supreme Court rules church can keep baptism records unchanged", Catholic News Service, 1 October 2008. This article "quotes" the concordat text as guaranteeing the "inviolability and confidentiality" of the church's archives and registries. However, Article I.6 of the text actually makes no mention of "confidentiality", citing only "inviolability", ("inviolabilidad" and "inviolabilità" in the Spanishand Italian originals).
3. "La Iglesia seguirá sin tener que borrar a los apóstatas de sus libros", Publico, 29 March 2011. http://www.publico.es/espana/368651/la-iglesia-seguira-sin-tener-que-borrar-a-los-apostatas-de-sus-libros
5. "Ángel, el apóstata", El Pais, 28 May 2006. http://www.elpais.com/articulo/sociedad/Angel/apostata/elpporsoc/20060528elpepisoc_1/Tes
6. "El Arzobispado de Valladolid se ampara en el Concordato y no da las cuentas a la juez de Gescartera", El Pais, 16 January 2002.
7. "El Tribunal Supremo obliga al Opus Dei a borrar los datos de una exmiembro", EFE, 4 December 2011