In March 2018, on the orders of the chief of staff at the time, John F. Kelly, Mr. McEntee was marched out of the West Wing, with no chance to collect his belongings, people in the building said then. His security clearance had been denied at least in part because of an online gambling habit, people with knowledge of the decision said, a move that came as Mr. Kelly sought to overhaul the process for granting such clearances.

Secret Service officials said then that they were looking into the matter involving Mr. McEntee, but no action was ever pursued, according to an administration official.

But Mr. McEntee remained in the Trump orbit, with the president’s re-election campaign hiring him a day later. That sign of good will for Mr. McEntee among the Trump family underlined the friction between some of the president’s relatives and Mr. Kelly. Brought on to impose order in the administration, Mr. Kelly tried — successfully, at first — to curtail the free-flowing access to the president that Mr. Trump encouraged among aides. Eventually, Mr. Trump’s desire to be around people he knows prevailed.

In the early months of the campaign in 2016, Mr. McEntee was a familiar face, making him one of a small group of people who had been with Mr. Trump from almost the start of his presidential bid. Mr. Trump enjoyed his company, asking him during the presidential transition to run the inaugural committee. That did not happen. But once Mr. Trump took office, Mr. McEntee was constantly around the president as his body man.