I see a lot of news sources, both left-leaning and right-leaning, mischaracterize the appellate court's order.
It was not a determination that Flynn is innocent, or that he shouldn't have been prosecuted, or that the DOJ has good reasons for dismissing the charges against him. It explicitly does not consider -- and prohibits the trial judge from considering --- any of those issues.
Here's a summary for non-lawyers.
1. Mike Flynn pleaded guilty to some criminal charges and was awaiting sentencing.
2. The DOJ then reversed course and sought to dismiss the charges against him.
3. Specifically, the DOJ says that it can no longer prove Flylnn's guilt beyond a reasonable doubt because he never should have been questioned by the FBI, so any lies he told during that questioning cannot have been material. (Materiality is required under the applicable criminal statute.)
4. By law, the DOJ may dismiss the charges "with leave of court." What does that mean? It means that the DOJ can request a dismissal, but the court, not the DOJ, does the actual dismissing.
5. The question is to what extent the court must simply rubber-stamp the DOJ's request, or to what extent the court should evaluate whether the DOJ's request is for a corrupt purpose and should therefore be denied.
6. There's case law saying that a court shouldn't grant a request to dismiss if the request is for a corrupt purpose -- for example, a court shouldn't allow the DOJ to keep dismissing and refiling, dismissing and refiling, just to harass a defendant. Rather, a court should dismiss a case only if dismissal is in the public interest.
7. So the trial court decided to hear argument about whether dismissal was for a corrupt purpose or whether it would be in the public interest. It appointed an amicus curiae ("friend of the court") to argue on behalf of the public interest so that opposing perspectives could be considered.
8. The DOJ went to the appellate court and said (paraphrasing), "Please stop the trial court in its tracks. The trial judge isn't supposed to look into whether we're being corrupt or not. It's supposed to just rubber-stamp our request without regard to any possible corruption."
9. The appellate court mostly agreed with the DOJ. In a 2-1 decision, the appellate court said that the trial judge shouldn't always grant a prosecutor's request for dismissal: it can still deny such a request if it's for the purpose of harassing the defendant. But it should always grant a prosecutor's request for dismissal as long as the defendant agrees with the request. There are only two parties here: the government (that is, the prosecutor) and the defendant. If they both agree on something, it's not up to the court to strike out its own contrary position. The "public interest" is not represented by the court or an amicus curiae. It is represented by the DOJ, which is not to be second-guessed except by the defendant. The defendant is the party most naturally positioned to hold a prosecutor's corruption in check. If the prosecutor and defendant are being corrupt together, well, maybe Congress can do something about it, but not the courts. The courts aren't authorized to look into it. The phrase "with leave of court" doesn't give a court the discretion to go against both the prosecutor and the defendant when those parties agree with each other.
10. This is not my area of law. I'm not a writ of mandamus guy. My understanding is that the appellate court's ruling here was a surprise. It kind of goes against the spirit of previous precedent and awkwardly steps on the normal powers of a trial judge to ensure fair proceedings in his courtroom. But it's not completely crazy -- even if there's approximately zero chance that Judge Rao would have decided it the same way if the request had come from, say, Biden's DOJ rather than Trump's. I mean, it's clear that Rao is a partisan hack doing partisan-hack things here. But even for a non-hack, the reasoning seems vaguely defensible, if not exactly airtight. (After all, she did get Henderson to go along.)
11. In any case, the main point here is that the decision has nothing to do with whether Flynn was mistreated, or whether the FBI overreached, or whether the DOJ is acting corruptly. It has nothing to do with substance, only procedure. The decision is effectively saying: "Even if Bill Barr wants Flynn released for super horribly corrupt political reasons, we're not going to look into it, and we're not going to let the trial court look into it. As a matter of procedure, the DOJ's request for dismissal may not be second-guessed by the judiciary, period."
12. I do think it would be interesting to see what the full court would say if it takes this up en banc.