Passengers arriving on a Delta flight from San Francisco to John F. Kennedy International Airport on Wednesday night were asked by U.S. Customs and Border Protection officials to produce identification as they exited the plane.

The request—in the context of sweeping changes to U.S. immigration policies under the administration of President Donald Trump—was met with confusion, alarm and speculation by some passengers.

There...