In August 2013, Judge Merrick Garland issued a ruling in a Freedom of Information case favorable to the Obama administration, stating that the White House's visitor logs are not agency records subject to Freedom of Information Act requests. And in choosing not to release the names of people who visit the White House, the Trump administration is taking advantage of that very decision, by the man Obama would later nominate for the Supreme Court seat that Trump just filled with someone else.
Garland's ruling overturned a lower court decision that rejected the Obama White House's assertion that the logs were not "agency records" and therefore not subject to FOIA. It delved into circuit precedent and applied a "four-factor test" as to whether they were, only to conclude that the test returned an uncertain result. He went on to note that "Congress crafted FOIA to avoid intruding on the confidentiality of presidential communications." He argued from there that the logs are essentially a Secret Service replica of the president's schedule, which would not be subject to FOIA, and are kept for the sole purpose of screening visitors and protecting the president, and should not provide a back-door way to get access to the the president's private communications:
Congress requires the President to accept the protection of the Secret Service. See 18 U.S.C. § 3056(a). And in order to protect the President, the Secret Service must monitor and control access to the building in which the President lives and works. To accomplish this, the Service requires presidential staff to request access for visitors, and thereafter requires logging of those visitors' entrances to and exits from the White House Complex. Those procedures result in WHACS records that replicate in key particulars the content of the President's appointment calendars and those of his staff, including the name, time, and appointment of the visitors who enter the White House Complex to see them. The President thus has little choice but to permit the Secret Service to reconstruct his appointment calendars. Hence, if the Secret Service must disclose WHACS records, a FOIA requester will effectively receive copies of those calendars.
Whatever the merits of this argument, based as it is on a mixture of tests created by judges in previous cases, this is the decision that allows President Trump to keep the records from the public, and it will do the same for future presidents as well.