As I understand Lost Cause theory, the claim was that the North was oppressing the South by not respecting states' rights, then the South rebelled justly but was destroyed by the North's industrial power, greater population, and Grant's brutal tactics. In their thinking, wouldn't that mean that Southerners should hate the United States (to the point of ongoing rebellion and resistance)? An oppressor doesn't become less oppressive because they won.
Was the claim something like, "After the losses of the Civil War showed the South wasn't going to just give in, the North learned to respect states' rights"?
I know that there have been posts on AskHistorians about when loyalty to the United States caught on again in the South (and I believe the answer was the Spanish-American War and WWI) but I thought this seeming contradiction between Lost Cause ideology and patriotism was worth asking.
Sorry I missed your question initially!
In short, the key aspect was providing the South, both the veterans and the South as a whole, a sense of honor. It provided an explanation for why they lost - overwhelming numbers which they couldn't overcome despite personal bravery - and gave them a worthy reason to be fighting - principles of liberty, hearth and home, defense of southern womanhood. While some Southerners remained unreconciled, to be sure, for many this provided an avenue to eventually reconcile their loss, and reconcile themselves to the Union while still holding their heads high for the cause that had led them away from it.
As you already mentioned, the Spanish-American War was of great importance here. It isn't that loyalty wasn't acceptable before then. Rather, in the mind of the South, what was important was that the conflict allowed Southern men to serve with valor in the war, and be recognized for it by their northern brethren. It was more the watershed point that paid-off on a build up of sentiment over the past two decades rather than the starting point of it.
So the short of it is that the South reconciled themselves to their loss with an explanation that they could never win, which in turn make reintegration and patriotism easier to stomach. Not immediately, to be sure, but within a generation and while those who had lived through it were still strongly influential in the society. Some on the fringe of course continued to damn the North and refuse to ever reconcile, but they were a minority.
I would heartily recommend Gaines Foster's "Ghosts of the Confederacy" for more on this.