The National Security Agency ended a program used to spy on German Chancellor Angela Merkel and a number of other world leaders after an internal Obama administration review started this summer revealed to the White House the existence of the operations, U.S. officials said.