The Secret Service might not have themed their code names for the John F. Kennedy administration on Arthurian lore, but that doesn't mean the names were entirely random — or that Kennedy wouldn't have had a hand in his own name. Secret Service code names go back to Harry Truman's time in office. American historian Michael Beschloss told NPR those who come under the agency's protection are given a list of possible code names, and the protectee can pick whichever one they like. Over the years, it's become a tradition to have the first family choose alliterative code names based on the first letter of the president's choice — hence the "L" names among the Kennedys taking after Lancer. And the designations aren't fixed once chosen. George W. Bush was known as "Tumbler" during his father's administration but opted for "Trailblazer" once he won the White House in his own right (per Vanity Fair).
Presidents may opt for a code name that resonates with them in some way. Historian Michael Beschloss suggested to NPR that Truman's code name, "General," was a bit of wish fulfillment on the once-captain's part. But according to the Chicago Tribune, a White House Communications Agency claimed the initial lists are arbitrary, and NBC New York reported that presidents typically don't publicly explain why they went with this or that moniker. Kennedy left no record on why he went with Lancer, though everyone from Vanity Fair to Britannica has suggested it has Arthurian meaning.