The National Security Agency has recommended that the White House abandon a surveillance program that collects information about U.S. phone calls and text messages, saying the logistical and legal burdens of keeping it outweigh its intelligence benefits, according to people familiar with the matter.

The recommendation against seeking the renewal of the once-secret spying program amounts to an about-face by the agency, which had long argued in public and to congressional overseers that the program was vital to the task of...