As several have noted, companies (including NGOs) did work for USAID that had been authorized by Congress and signed into law by the president. Trump illegally tried to welch on those debts and the court said "no you must honor your contractual debts". Pretty simple.