The South always made its identity based on being "true Americans" unlike corrupt Yankees. To destroy the South, you need the North not to make a compromise with the South in the 1870s and to be fully committed to destroying the South and northernising it. That would take one hell of an effort on the part of the government. So much has been said about Reconstruction, and it's obvious it would be very, very difficult to actually accomplish. But it would suppress the Lost Cause ideology in that it would be strangled in the cradle.
The South was very fucked up. They replaced the fucked up slavery ideology with something slightly less fucked up. Something where abusing random people (as long as you were white and they were black) was acceptable. And then you have the North where they made their own crap with their own racial laws. I suppose you'd have to make Jim Crow even worse and spread it nationwide. That seems the most likely. I suppose there's other suggestions which verge on comically evil, like genociding all Native Americans and Asians (Nazi style), but that goes against even 19th century policy toward those people.
You can make the Confederate flag truly bad if you treat it less as a symbol of rebellion and the South but if you treat it as an unpatriotic, anti-American symbol. But it's unfortunate that the Confederacy and the people defending them in the Reconstruction era (and before) portrayed themselves as the ultimate Americans trying to save America from itself. Americans--especially Southern Americans--need to treat the Confederacy and their symbols as failures and anti-Americans. "Violence and rebellion isn't the way real Americans solve things." Or something.
One other answer aside from looking back on the Civil War, slavery, and its aftermaths is to look at World War II and Japan. Can the United States invade Japan, kill tens of millions of Japanese in various ways (nukes, chemical warfare, conventional warfare), and still be a good nation? I'm basing things off the Decisive Darkness timeline here. After all, Admiral Halsey's quote "Before we're through with them, the Japanese language will be spoken only in hell" was a thing.