America has always, and WILL always be flawed. But that doesn't mean it hasn't been great, or been on a quest for greatness, many times.
The Declaration, and the Constitution, were amazing documents for their time. They weren't perfect (the stain of slavery remained, obviously). but the cornerstone for representative democracy was unique....and definitely great.
The incredible sacrifices of that time were definitely great.
And that Lincoln basically gave his life for the cause should not be ignored.
America could have remained isolationist. Even after Pearl Harbor and Germany's declaration of war, they could have chosen to go to war only with Japan.
It brought about a world that is the most peaceful and prosperous in human history.
Historically, great powers would have razed and destroyed the conquered. We did neither. We spent money, rebuilt them, and let them govern themselves.
But that doesn't mean we aren't great. And most of the world? They view us as great too, FWIW.