The concept of "innocent until proven guilty" is inherent in our constitutional protections for due process.
As far as I know, the Supreme Court first formally recognized it as a rule in Coffin v. United States, 156 U.S. 432, 458-59 (1895):
Now the presumption of innocence is a conclusion drawn by the law in favor of the citizen, by virtue whereof, when brought to trial upon a criminal charge, he must be acquitted, unless he is proven to be guilty. In other words, this presumption is an instrument of proof created by the law in favor of one accused, whereby his innocence is established until sufficient evidence is introduced to overcome the proof which the law has created.
The key phrase -- for purposes of your question -- is "sufficient evidence." At a criminal trial, sufficient evidence consists of proof beyond a reasonable doubt on “all the essential elements of guilt” In re Winship, 397 U.S. 358, 361 (1970).
But if the government wants to lock up a defendant pending trial, the question is not whether the defendant is guilty of the charged crime, but rather whether he poses a danger to the community and can be trusted to appear for trial. 18 U.S. Code § 3142(e)(1). And on those questions, he retains the presumption of innocence, but the government's burden of proof when arguing otherwise is substantially lower. The courts recognize both the potential of fleeing from the court and the prevention of additional crimes as legitimate bases for pretrial detention.
In cases like Avenatti's, where the government is seeking pretrial detention because the defendant is a danger to the community, it needs to prove by clear and convincing evidence "that no condition or combination of conditions will reasonably assure the safety of any other person and the community." 18 U.S. Code § 3142(f)(2).
However, if the government is seeking to hold the defendant because it does not believe he will appear for trial, it need only prove its case on that question by a preponderance of the evidence. United States v. Martir, 782 F.2d 1141, 1146 (2d Cir. 1986) (“For detention to be proper, the government had to prove by a preponderance of the evidence that no conditions of release would reasonably assure Martir's attendance at trial.”).
As a side note, I'd agree with some of the answers that in practice, the bond system is regularly abused to the point that its underlying principles become unrecognizable. My answer is meant only to address the actual legal rules your question implicates.