WASHINGTON—President Trump’s declaration of a national emergency to build a wall on the U.S. southern border comes after two years of political neglect of his signature campaign promise, lost amid competing priorities and divisions within his administration, according to current and former White House officials, lawmakers and congressional staffers.

Mr. Trump on Friday said the move would allow him to supplement the $1.38 billion allotted for border barriers in the spending package approved by Congress—far short of the $5.7...