WASHINGTON—The Obama administration’s rejection of the Keystone XL pipeline Friday ends a seven-year saga with a declaration that the project is not in the national interest and would undermine U.S. global leadership in fighting climate change.

The permit denial, which was cheered by environmentalists and lambasted by the energy industry, capped a politically charged review of the oil project that had escalated into a broader debate on climate change, energy and the economy. In the end, the administration’s decision likely...