A federal judge ruled on Tuesday the Obama administration must turn over thousands of documents about the botched “Fast and Furious” gun-tracking operation to House Republicans, rejecting White House claims that the papers were shielded by executive privilege.

U.S. District Court Judge Amy Berman Jackson issued the 32-page ruling in a long-running lawsuit brought by the House Committee on Oversight and Government Reform. The suit sought access to internal Justice Department documents about the troubled operation, which sought...