WASHINGTON—Attorneys representing the Trump administration laid out an expansive view of a president’s power to control media access, saying in a court hearing that the president has the right to exclude reporters from government property for the content or tenor of their reporting.

U.S. District Court Judge Timothy Kelly on Wednesday heard roughly two hours of arguments on an emergency motion to restore the press credential of Jim Acosta, a CNN reporter whose access to the White House was revoked last week. The motion came...