That is called "double jeopardy". It is explicitly prohibited in most legal systems. Even where it isn't explicitly prohibited, it's generally assumed as a basic principle (like innocent until proven guilty).
It's basic: if someone can be retried because of new evidence, the prosecution will introduce a little bit more evidence (probably evidence they intentionally held back!) after each acquittal, and try them again.
The Americans in particular take it much further than some do; here in Canada the prosecution can appeal from an acquittal due to legal error in the decision; the prohibition on double jeopardy only applies to the entire process as a whole, after a final verdict including appeals. In the USA, a verdict issued by a jury, even at the first trial, is generally final and cannot be appealed even for reasons of legal error, while a guilty verdict can be appealed. American pluricentric power does create an odd circumstance where you can be tried twice in practice, though. If the federal government prosecutes someone for a crime, and fails to convict, if it was illegal under state law, the state government can try again under state law, or vice versa.