The ruling by a D.C. appeals court panel is a win for the Trump administration that had blasted the program as a waste of taxpayer money.