Prosecutors have great discretion on whether to bring a case in the first place and normally on whether to dismiss it at any point in the proceedings, including at trial. Under the U.S. legal system, prosecutors are supposed to (in theory, at least) be concerned with the idea of upholding justice first and foremost and only secondarily with gaining convictions. I think what probably offended the judge here most was that this prosecutor seemed bent on gaining a conviction at any cost, even if it was based on twisting the evidence and law solely to that end and regardless of whether it was right or not. In any case, at this point in this case, the prosecutor can simply dismiss the case and that would end it. If he does so, I doubt that any further repercussions would follow, since I don't think what he did here was so extreme as to warrant formal sanctions against him.
In extreme cases, prosecutors can be hit with charges of ethical misconduct and sometimes disbarred for abuse of their position. A recent case (where the prosecutor wound up resigning before being actually forced out) involved the prosecutor of the Duke lacrosse players who wound up admitting that he had conducted the prosecution for political reasons even in the absence of evidence for maintaining it (see the write-up here for details: http://www.nytimes.com/2007/06/15/us/15cnd-duke.html).
In extreme cases, prosecutors can be hit with charges of ethical misconduct and sometimes disbarred for abuse of their position. A recent case (where the prosecutor wound up resigning before being actually forced out) involved the prosecutor of the Duke lacrosse players who wound up admitting that he had conducted the prosecution for political reasons even in the absence of evidence for maintaining it (see the write-up here for details: http://www.nytimes.com/2007/06/15/us/15cnd-duke.html).