WASHINGTON—The controversy over President Trump’s selection of Matthew Whitaker as acting attorney general reached the Supreme Court on Friday, as a prominent litigator filed papers arguing that even temporary cabinet appointments must be filled with people already confirmed by the Senate.

Thomas Goldstein filed the motion in a pending weapons-possession case in which the attorney general serves as the formal defendant. Under court rules, an official who steps down—in this instance, Jeff Sessions, who resigned on Mr. Trump’s...