For example, Phillip II of Habsburg Spain and his wife Mary's full title was:
"Philip and Mary, by the grace of God, king and queen of England, France, Naples, Jerusalem, and Ireland, defenders of the faith, princes of Spain and Sicily, archdukes of Austria, dukes of Milan and Burgundy, and Brabant, counts of Hapsburg, Flanders, and Tyrol."
It seems feasible for them to rule any of those territories in Europe, but unless I'm confused with locations Jerusalem was located in the middle of the Ottoman Empire at the time. What was the value in claiming to rule something you obviously don't?
(Side question: why are they referred to as "princes/dukes/counts" of some states and not "prince/princess, duke/duchess, count/countess"? King and queen are gender-differentiated but the rest aren't.)
I work on Charles I (Charles V) and I often wondered about that. His titles also included the kingship of Jerusalem and nearly every other ridiculous place on earth. While this goes too far back in my own expertise, you have to start with Frederick II in the 13th century. During the 6th Crusade, he may (or may not) have claimed the title for himself since his wife had actually been a member of the royal house in Jerusalem. When she died and Frederick was attempting to negotiate a peace between Christendom and Egypt, it seems that he had himself declared king of Jerusalem.
From the Hohenstaufen it fell to another royal house, but by the end of the 1200s there was no real claimant, just houses fighting over the title and occasionally the territory. Charles of Anjou apparently bought the title with the approval of the Pope from one of the claimants. It thereafter became part of the title for the king of Naples and Sicily. Alfonso V of Aragon captured Naples in the mid 1400s and his line was able to use "King of Jerusalem" as part of their title. The Aragonese lost Naples a few years later, but Fernando II of Aragon took it back in 1504. Since he had driven the Moors out of Spain, the Pope was happy to reconfer the title of King of Naples to Fernando, and with it the title of King of Jerusalem. Charles I (V) was Fernando's grandson and Philip II was the son of Charles I (V).
I believe that there is still some dispute over who carries the title, especially after the Spanish Hapsburg line died. This is matter that gets quite a bit of discussion during the 15-16th centuries, but I find it tedious.
For some views on how these issues were handled by Charles I (V) see Kleinschmidt Charles V: World Emperor, Chapter 4.
EDIT: I realized that I didn't actually answer your main question. Did they try to exert influence over Jerusalem? No. Although Charles I (V) did try to address the problem of Ottoman expansion into Europe, he was too involved in wars and economic problems to organize a crusade-like operation to actually retake the Holy Land. Philip II was probably more religious than his father and even he did not see the benefits from trying to take the lands. All that mattered was that the Pope recognized their titular claims, which he (they) did. If the Pope agrees you are the King of Jerusalem, you get to flaunt that over your royal counterparts. Charles I (V), Henry VIII, and Francis I apparently liked to bicker over such things.