The importance of following precedent, and the principle of stare decisis were inherited by the early US legal system from the British Common Law system, and have been taken as part of the natural order of the legal system by US courts ever since.
This extends even to a court overruling itself. US Courts are notoriously reluctant to overrule their past decisions, even when current court members agree, However they will do so from time to time. The US Supreme Court in particular will flatly overturn previous decisions, especially on Constitutional issues, when it thinks there is no other way to achieve a proper outcome, although it often prefers to distinguish the prior decision without actually overruling it.
I think the fastest and most extreme case where the US Supreme Court overruled itself was that of West Virginia State Board of Education v. Barnette, 319 U.S. 624 (1943), the second flag-salute case. (This was also a particularly significant case.) This reversed Minersville School District v. Gobitis, 310 U.S. 586 (1940) a case on the exact same issue, only three years previously, and a vote of 8-1 on the first case became a vote of 6-3 the other way, with only one new Justice on the Court. Only Justice Frankfurter, the author of the fist decision, issued a dissenting opinion in the Barnette case, and no other Justice formally joined that opinion.