The last week of June saw the effective end of DOMA and passage of a landmark Senate immigration reform bill. Both will widen access to Social Security, although the exact extent is still unknown. But it also saw the Supreme Court wipe out the enforcement mechanism for the landmark Voting Rights Act. The latter, unfortunately, will have a powerful if indirect effect on the future of Social Security, making last week less of a cause for celebration than it might have initially appeared.

The U.S. Supreme Court’s decision to strike down the operative provision of the Defense of Marriage Act, opening the way for federal recognition of same-sex marriages, was an astonishing and welcome development for equal rights and social justice in America. It also represents the first major expansion of Social Security in 40 years. There are well over 130,000 same-sex marriages in the U.S. today—over 115,000 with children—and that number will no doubt burgeon as more non-traditional couples add the prospect of Social Security, Medicare, and other federal benefits into their personal finance calculations.

The just-passed Senate immigration reform bill represents, at least potentially, an even greater expansion, enabling millions of undocumented workers to start accumulating benefits under Social Security. There are a lot of ifs here: We don’t know what kind of bill the House will come up with—perhaps it won’t act at all—and what the final measure coming out of reconciliation will look like. Worst-case, millions of people who have worked for decades in the U.S. will be obliged to start over with Social Security, essentially saying goodbye to the payroll taxes they contributed all along with nothing to compensate them.

There is a lot still to know about the effects of the DOMA decision as well, specifically what kind of regime will apply to gay and lesbian couples living in states that don’t recognize same-sex unions, short of Congress passing a law creating a federal definition of marriage. But the movement forward in both the Senate and the Supreme Court is undeniable. Social Security and Medicare aren’t just government benefits, but a form of institutionalized mutual aid that needs to respond to the changing needs of its constituency if it’s to remain alive and vital. Failing to respond to new needs arising from the changing definition, on the ground, of households, families, and who is or is not an eligible working person in America would be almost as deadly to these programs as the efforts by the right and center-right to privatize it or whittle it away.

Because the most ominous fact about the 30-plus-year war against Social Security is perhaps not the constant assaults it has faced in Washington—and not from the rest of the country, where it remains enormously popular—but the fact that its last significant expansion came in the early 1970s, when annual benefit increases were automatically indexed to the cost of living. Since then, the discourse about Social Security has been so dominated by the right and center-right that it’s been impossible even to make modest improvements such as raising the minimum benefit, boosting payments to surviving spouses, and crediting workers who take time out to care for children or aging family members. The fact that in spite of this, Washington now seems to be ready to extend benefits to some same-sex couples and permit undocumented workers to participate to some extent is a sign that even The Village can’t entirely ignore the changes taking place beyond the Beltway (and even within it).

And by the way, neither change will break us. According to the Congressional Budget Office, the additional cost to Social Security in 2014 of recognizing same-sex marriages in 2004 would be $350 billion over 75 years. That raises the estimated impact a grand total of .01% of covered payroll, from 16.03% to 16.04%. Meanwhile, Social Security chief actuary Steve Goss calculates that immigration reform as embodied in the Senate bill will add $500 billion to the assets in the Social Security trust funds over 25 years, and $4 trillion over 75 years. (One major reason is that these immigrants don’t have parents collecting benefits—when they retire, their children’s contributions will cover their benefits.)

It’s been said, however, that Chief Justice John Roberts plays a long game—seemingly conceding certain points to progressives, as he did on Obamacare and, last week, DOMA, to provide cushion for the more conservative and, in many ways, more significant decisions his allies make at more or less the same time. Last week, the Roberts Court balanced out the DOMA ruling with the near-total evisceration of the Voting Rights Act. This might not seem to affect Social Security, but it most definitely does.

If anything, this is an extremely odd time for anyone concerned about electoral rights to want to weaken the VRA. As the New York Timespointed out,

Congress has compiled a huge record showing that gerrymandering, use of at-large voting in cities with a sizable black minority to eliminate the power of minority votes and other barriers to equality in voting justifies the clearance formula the court struck down as failing to meet “current needs.”

To this I would add the rush by states with Republican-controlled legislatures to slap voter ID requirements on their citizens. Taken together, these legal changes along with the Supreme Court’s VRA decision constitute an unmistakable push to disenfranchise minority voters. It’s a campaign that actually began in the South almost as soon as the VRA was passed and at first consisting mainly of tinkering with the hours when polling places were open, but that in recent years has metastasized and spread across the country in inventive new ways.

This is more than ominous for Social Security, I argue, because racial justice will be possibly the most important determinant of the program’s fate over the next few decades. Historically, the period of elite backlash against the major New Deal programs, and Social Security and Medicare in particular, corresponds roughly with the rise of white backlash against civil rights—and, just as importantly, welfare rights—in the early 1970s. The signature middle-class mobilizations of that period, against school busing and property taxes, especially, constituted a revolt against the principle of social solidarity, the assertion that those who have, should help to create better conditions for those who have not to attain a minimum standard of living and prosper in the future.

“NIMBYism” extended to Social Security in the form of the argument—already frequently heard in the ’70s—that “generational equity” requires every age cohort of workers to pay its own way. Otherwise, the system is somehow unfair. It’s useful to note that members of the Tea Party, the political heirs of the Nixon-era “Silent Majority,” don’t object to Social Security itself—only to “undeserving” people getting benefits.

White-majority racial attitudes are thus a crucial part of the cultural context that allows elites to attack and destroy, or at least chip away at, institutions that underpin social solidarity. Even in Europe, supposedly the bastion of institutionalized social justice, attacks on and “reforms” of old-age income programs have occurred at more or less the same time as the alarming backlash against Islamic immigrants from North Africa in France, Italy, the Netherlands, and other countries.

As in the U.S., the same leaders in general are not identified most closely with both trends. Efforts to limit social justice programs and especially old-age social insurance programs are largely an affair of the elites, and especially those connected with the banking sector. Rage against immigrants is the work of right-wing populist demagogues. But the one feeds off the other by encouraging middle- and lower middle-class people to look upon benefits paid to poorer people and people of color with suspicion, even to the point of accepting cuts in benefits that are vital to their own economic well-being as part of the price of continuing to view themselves as somehow more virtuous than those “others.”

I would argue further that it was possible to put social insurance programs in place in the U.S. starting in the ’30s, and to vastly improve them in Europe in the postwar years, in part because of the unspoken assumption that benefits would flow principally to people like themselves. Neither European societies nor the U.S. were ever as homogeneous as the white middle class liked to think, but until the Civil Rights era in America and the great expansion of immigration in Europe a couple of decades later, it was possible to maintain that cultural fiction.

Which brings us back to the VRA and the Supreme Court. Despite all the progress that was made in the middle of the 20th century, modern industrial states have yet to prove they can maintain institutions of social solidarity as they morph into more diverse, multicultural societies. If anything, the countervailing pressures seem to have a good chance of overwhelming those institutions exactly when they are most needed.

The U.S. is quickly becoming a majority-minority country. Definitions of household and family are changing rapidly as well (the U.S. has yet to see any meaningful response to the fact that more and more households choose not to form around marriage at all). The DOMA ruling and the Senate immigration bill suggest that our elites recognize these facts, to a limited extent, and that Social Security will change to meet them. But last week’s VRA ruling also makes clear that the right is going to dig in to maintain a white upper hand in America for as long as it possibly can, even if this means officially recognizing two classes of workers and a patchwork of laws offering same-sex couples different status in different states.

What does this mean for an institution like Social Security, which must evolve if it’s to survive and remain relevant to its participants? At worst, it means that the triumph of NIMBYism is going to make it even harder to defend against efforts to maintain consciousness of the need for social solidarity in a complex industrial and post-industrial economy, without which the elite push to “reform” these institutions out of existence will be far more difficult to resist. The project to keep Social Security and Medicare viable can’t be race-blind. Unless social and economic justice is achieved in the U.S., maintaining and improving these programs will become an increasingly up-hill struggle.