The 1776 Declaration of Independence and the Constitution of 1787 were all flawed. The first ten Amendments that followed quickly (around 1789) hardly began to fix them.
It’s idle to pretend that the group of highly educated, very cultured men who composed and promulgated them only allowed slavery because it sounded like the right idea at the time. In fact, there was never any moment in pre-American history when abolitionism was not a doctrine vigorously and clearly enunciated – by the Quakers among others.
The writers of the Declaration and the writers of the Constitution (two much overlapping groups) were all, if not Christian themselves, close descendants of Christians living in a Christian society. Of course, they knew that slavery was wrong. Of course, they spent a lot of intellectual energy minimizing in their own minds how dreadful it was in practice.
So, yes, slavery on a large scale tarnished the founding of the American Republic. The Founding Fathers were not saints in any way, shape of form. Few men are saints, by the way (or women, for that matter!) That’s why they need constitutions. The Founding Fathers were just way ahead of everyone else. The institutions they devised lasted us largely for nearly 250 years. They were copied more or less everywhere. They still are.