The official Catechism in Spanish for the 6th commandment starts in the same way as the version in English:
«No cometerás adulterio» (Ex 20, 14; Dt 5, 17).
«Habéis oído que se dijo: “No cometerás adulterio”. Pues yo os digo: Todo el que mira a una mujer deseándola, ya cometió adulterio con ella en su corazón» (Mt 5, 27-28).
(The version in English):
You shall not commit adultery.
You have heard that it was said, "You shall not commit adultery." But I say to you that every one who looks at a woman lustfully has already committed adultery with her in his heart.
In fact, the whole chapter about the sixth commandment is the same in Spanish an in English in terms of content: the same doctrine is taught in Spanish as in English. It must also be emphasized that the chapter on the sixth commandment includes more prohibitions than the bare and technical act of adultery (a married person voluntarily having sex with someone other than said person's spouse). The Catholic Church has always held that the lesser crimes against sexual purity are implicitly included in the graver formulation of the commandment, and the entire chapter thus unpacks what is held to be implicitly there.
HOWEVER, more to the point of the question: right before the section on the ten commandments (that is, right before the Section two of the Third Part) there is a triple formulation of the commandments. (In languages other than English, the triple formulation is shown as a table). The first column shows the formulation of the commandments in Exodus, the second column their formulation in Deuteronomy --- the books in the Bible have different wording for them --- and then "A Cathechetical Formula" in the last column. It is in this Cathechetical formulation that the Spanish and the English have the wording discrepancy that the question is asking. The English has "You shall not commit adultery", whereas the Spanish has "No cometerás actos impuros" (which translates to 'you shall not commit impure acts').
First, it must be pointed out that the difference in wording does not somehow change the underlying prohibitions. The chatechetical formulation is meant to be a short-hand for the fullness of the commandment, which the Catechism will expound at length in the corresponding chapter for said sixth commandment.
Nonetheless, why the difference? Why is the Spanish version more broad --- and therefore more descriptive of the fullness of the commandment --- while the English version is much more specific?
A comparison with the wording of the same commandment in the Catechism in other languages will be helpful. In French the sixth commandment reads "La pureté observeras en tes actes soigneusement" (which translates roughly as 'You will observe purity in your actions conscientiously'). In Portuguese it reads "Guardar castidade nas palavras e nas obras" (which is roughly 'You will guard chastity in your words and in your actions').
So, languages other than English are more broad in their statement of the sixth commandment than English, but all of them have slightly different wording for it. What gives?
Let's speculate! A clue is given by a reference in the Spanish & French translations which is not given in the English translation: in the Spanish version to "Catecismo Católico, preparado bajo la dirección del Cardenal Gasparri (Libreria Editrice Vaticana 1933, pp. 23-24)", and the French one to "P. Card. Gasparri, Catechismus Catholicus, Vatican 1933 p. 23". Obviosly this is a reference to a Catechism prepared by Cardinal Gasparri, published in 1933. Very likely that catechism was published in Latin, and then was translated into different languages. And probably the different translations of that catechism served as the template for the wording of the commandments in the translations of the universal Catechism of the Catholic Church (which was officially promulgated in 1992, in Latin).
Why was the wording of the sixth commandment expressed in the way it was in the translations of Cardinal Gasparri's Catechism other languages to begin with? Probably the translators relied on traditional forms of the commandment that had grown over centuries in the particular languages into which they translated. After all, it would be somewhat unsettling for some to go to sleep with one version of the commandment and wake up with another version of it.
This still doesn't explain why all of the translations mentioned above expressed the prohibition in broad terms, while the English expressed it in narrow terms. It seems that the broad expression is more in keeping with the aim to explicitly indicate that the commandment is more general and covers much more than a married person having sex with someone else other than said person's spouse --- as the Catholic Tradition holds. In other words, why was the English version of the commandment narrow? It seems that the English version is the one that is the odd one out.
A hint is given by the heading of that third "catechetical formualtion" column in English. The complete heading is "A Traditional Catechetical Formula". Where might this traditional catechetical formula have come from, if not from Cardinal Gasparri's translation? My guess is that the reason for keeping the narrow formulation in English is the same as the reason for the variation of the formulations in other languages: the desire not to cause unease by a possible perception of having changed the commandment. In other words, the English version of the commandment had always been "You shall not commit adultery", and therefore that version was kept.
Why was the English version of the commandment "you shall not commit adultery"? Blame the Reformation for that one. After the death of King Henry VIII --- who took the Anglican Church out of communion with the Catholic Church because he wanted to divorce his wife --- the English government decided to abandon the Liturgy in Latin, and the first ever Book of Common Prayer was published in 1549. The Book of Common Prayer was revised in 1552 to move the Church in a more Protestant direction. Of note, in this second edition a recitation of the Ten Commandments was added to the communion service. And the sixth of those commandments was "Thou shalt not commit adulterie". Then Queen Elizabeth had the Book of Common Prayer revised once again in 1559 to chart a "middle ground" between the Catholic and Protestant sensibilities of the time, and again the sixth commandment given as part of the communion service reads as "Thou shalt not committe adultery".
The Elizabethan Book of Common Prayer had great influence in the Empire. It was in force for about 100 years. And while there might have been earlier published versions of the ten commandments, I think it can be argued that the (enforced) widespread use of the Book of Common Prayer helped cement the formulation of the ten commandments in use in the English language today. Thus the sixth commandment in English --- by virtue of hundreds and hundreds of years of traditional use --- is "You shall not commit adultery".
Why did the editors of the Book of Common Prayer choose that formulation, instead of a broader one, like the Catholic Church ended up doing? I bet it had to do with Protestant sensibilities: they were not going to rely on the authority of any "Popish" church (as they might have put it), and instead were going to rely solely on the authority of Holy Scripture. And since the Bible mentioned the specific form of "You shall not commit adultery", they went with that.
One final note about the different versions of the Ten Commandments in particular --- and about documents issued by the Catholic Church in general. The note can be motivated by the following question: so, which of the versions of the ten commandments is the "correct" one? In some respects, it does not matter, because the catechetical lists are merely short-hand expressions for all the implications of the commandment, which the Catechism amply expounds in all languages. But in case it were to matter for some reason, the answer can be given: the "correct" version of any document (including the Catechism) is in whichever language the official version of the document was published --- which is usually Latin (but not always so!).
In the case of the Catechism, the official version is in Latin, and the quoted bible passages likely come from The Vulgate (a Latin translation of the Septuagint), or its updated edition, the Nova Vulgata. Therefore, the official version of the sixth commandment, as articulated in the Catechism of the Catholic Church is "Non moechaberis". Everything else is translation.