It is true that Jaime de Marichalar and Iñaki Urdangarin were referred to as Duke of Lugo and Duke of Palma de Mallorca and were often cited by the prefix "Excelentísimo Señor" in Spain, even perhaps by the Royal Household itself.
However, as some legal scholars argued at the time, apparently to no avail, that was actually a misconception. When someone in Spain is given a Title of the Kingdom by royal decree, that title belongs to the grantee and can be transmitted hereditarily to his or her successors according to the terms of the concession and the Spanish nobiliary law currently in force. The use of the title also extends by courtesy to the legal spouse according to Spanish custom, which is why the husband of a Spanish duchess in her own right is addressed also as a duke.
The titles of nobility belonging to the Royal House, which are the object of the Art. 6 of the
Royal Decree 1368/1987 are not, on the other hand, transferred to the grantee as an ordinary Title of the Kingdom. Instead, the King merely confers on the grantee, who must necessarily be a member of the King's family, a
right to use the title, rather than the title itself. The concession of right is said in the RD to be "for life", but at the same time
ex gratia, which is why the King can revoke it any time. The notion that it is the right to use the title which is being revoked, rather than the title itself, is made clear for example in the text of the
RD 470/2015.
Another important aspect of Art. 6 is, furthermore, that the concession to members of the King's family of the right to use titles of nobility belonging to the Royal House is "personal", in addition to being "ex gratia" and "for life". That means, according to one interpretation, that the right of use of the title is strictly
non-transferrable and does not extend, by courtesy, to the spouse, as it would be the case of an ordinary Title of the Kingdom.
Again, all that was ignored by the Spanish press (or maybe even the Royal Household) when they treated the dukedoms of Lugo and Palma as ordinary Spanish dukedoms to determine Jaime's and Iñaki's titulaire. Strictly speaking, however, if the King wanted to make sure that their sons-in-law had a title, the correct procedure would have been to bestow a hereditary peerage on each of them, which the King could have done, as the RD 1368/1987 says, under the powers granted to him by Art. 62(f) of the constitution. That would have required, however, another Royal Decree countersigned by the Prime Minister.
Could it have been the case that the Government was OK with the use for life of titles of nobility belonging to the Royal House by the Infantas Elena and Cristina, but did not agree to hereditary peerages for Jaime and Iñaki, which could then be transmitted to Felipe Froilán and Juan Valentin under the regular order of succession?