You say this like it would have been a bad thing!
Look, either JFK or one like him claims to be a Catholic but doesn't actually submit to the teachings of his religion (IOW, he's a fraud), OR he's willing to contravene his conscience because his political ambition trumps his conscience (IOW, he's an amoral opportunist), OR he's lying when he says he puts, as you put it, "his duty to the laws of the US above his obligation to Rome".
Fraud, amoral opportunist, or liar ... some choice.
However, I understand your concern that good Catholics ought to follow the dictates of Church doctrine.
The difficulty arises in two areas:
1st--if their civic duty and religious duty conflict; and
2nd--does a foreign sovereign have the right to command American citizens in the performance of their duties to the republic?
In the first instance, painful as it may be, it seems to me that the only honorable course if one's civic responsibilities (freely undertaken as in public office) conflict with religous duty, is resignation.
In the second instance, the answer, of course is an emphatic NO. I believe that neglect of civic responsibilities at the behest of a foreign sovereign, such as the Pope, is seditious at least, if not treasonous.