SAN FRANCISCO—The Federal Bureau of Investigation would lose a powerful tool against terrorism if a federal ruling against the agency’s use of secret requests for information about individuals’ phone usage and electronic transactions isn’t overturned, a U.S. lawyer warned an appeals court hearing the matter.

The agency each year issues thousands of the so-called “national security letters,” or NSLs, Justice Department attorney...