What happened?
Did the district court have the authority?
Can payment be withheld?
Legal issues?
If the leader changes, does the contract?
What Happened?
Did the District Court Have the Authority?
The district court is a federal court.
Thus that district judge does have the authority to order the federal government to pay.
With this is mind, the dissenting opinion makes neither judicial nor logical sense. The dissenting opinion reads like a subjective, political viewpoint, not an objective, law interpretation.
*Federals matters are those undertaken by the federal government. Like the Trump administration's decision to refuse invoice payments.
Can Payment be Withheld?
Payment of services rendered is a legal requirement. If it's already been done, it has to be paid for. (If, of course, payment has been agreed upon.)
A government can rescind further funding. This happens by terminating the contract. However, this doesn't permit the government to withhold monies owed.
Essentially, the government can refuse to pay for what could be done but they can't refuse to pay for what has been done already. Once the job as happened, the money has to happen, also.
Termination of contract does not equal unpaid invoices.
Yes, in some instances payment can be refused (whether by government, company or individual).
However, this refusal can only come if the contractor hasn't abided by their contractual obligations. This includes things like poor quality, time constraints, not adhering to the project's goals etc. As such, there is nothing to pay for.
So when work completed has complied with contractual obligations, there is no legal reason why payment can be withheld. There's no sign the government thinks that contractors failed in their legal duty, so why is the government failing in theirs?
Legal Issues?
Considering contracts legally must be obeyed, it's obvious that withholding money for services rendered is illegal.
The executive branch of government, the institution responsible for enforcing the law, should act lawfully. So this example of the executive wanting to break the law (by willfully ignoring contractual obligations) should stun people.
The courts have a legal obligation to uphold the law. Just because the government has the audacity to break the law doesn't mean the courts should, too. The fact the dissenting Justices didn't want to uphold the law should stun people.
If the Leader Changes, does the Contract?
Some claim that the Trump administration doesn't have to pay for this work because it wasn't ordered by the Trump administration.
(Claimers of the above would most likely be furious with the reverse: that the next administration doesn't pay for work ordered by the Trump administration. Either that or they'd have to accept their reasoning being used against them.)
But if this reasoning was applied to real life, what would the consequences be?
A change of leadership permits non-payment of work already completed?
If this were the case, companies would just change the boss every time work was completed. The boss would say they legitimately don't have to pay because they weren't the one to sign the contracts.
This wouldn't just affect a company's contractors but also the company's own staff! Who would anyone be willing to sign any sort of work contract if they knew the agreed-upon payment/wage could be denied?
Hence economic activity would dry up, from agriculture to education and steelworks to healthcare. The economy wouldn't survive that.
Also, substitute 'company' for 'government'.
If the government couldn't get/retain workers, the government couldn't manage the decline of the economy. Nor could they ensure the safety of the public (infrastructure, healthcare, food, power, policing...)
The stewardship of the country's economy/safety are the government's role and purpose. So for a government to act against its very purpose? That should stun people.
Conclusion
The government thought they could get away with withholding monies owed. The dissenting Justices were stunned that the other Justices wouldn't let the government get away with it.
The fact that the executive, and the dissenting judicial, decided it was legal leaves one stunned. The fact that the government would be acting against their very purpose (if they got their way) also leaves one stunned.
Whether someone agrees with foreign aid funding or not, that doesn't mean legal obligations should be ignored. Especially when the law is the purview of the people breaking it.