I was once told that somewhere, on some federal building, is the inscription "The government never loses when justice is done to one of its citizens." I don't know what building the inscription is on; I don't even know if the inscription exists. However, for any lawyer who does criminal defense work, as I do (among other things), this epigram, whatever its source, is likely to resonate.
This statement underscores the idea that a criminal trial, though adversarial, is not a competition. It is instead a mechanism to come as close as possible to learning the truth about an event and a particular person's role in that event. The word "verdict" come from the Latin for "speak the truth". The finder of fact, whether a judge or jury, listens to the evidence and is then charged to render a verdict, to speak the truth.
I have been asked a number of times whether I ever represent anyone I know is guilty of the crime they are charged with committing. "How can you represent anyone you know is guilty?" is a variation of this question. These questions are amusing to a lawyer because most people charged with a crime have done something that resulted in them being charged. Not everyone, as there are people charged with crimes who have done nothing wrong, but most.
As I said earlier, the criminal justice system is a mechanism, a mechanism through which the government seeks to meet its burden of presenting enough credible evidence for a finder of fact to believe, beyond a reasonable doubt, that someone is guilty of commiting a crime. The rules that apply to criminal trials are more than "technicalities". They are a check on the government's ability to prosecute its citizens. Look around the world and you can see countries where the absence of these "technicalities" results in brutality and injustice. It's good for governments to have checks on them; it keeps them accountable to their citizens.
When there is a fair trial, where the rules of court and the law have been correctly applied, justice has been done, in theory at least, whether the defendant is acquitted or found guilty. An acquittal after a fair trial is not a loss for the prosecution because our system is designed to allow for acquittals. Hence the saying that the government never loses when justice is done to one of its citizens.