Why does a place as big and beautiful as Orange County so often behave in ways that are both small and ugly?

That’s the question that occurs after the county government made two recent decisions so stinky that it could be years before the smell wears off.

First, county supervisors voted to oppose state sanctuary laws that provide some peace of mind to the immigrants upon whom Orange County depends economically and socially. In the process, the county aligned itself with President Trump, who has targeted California in a campaign of lies and mass deportation, and against many of the county’s own families.

Second, the county abandoned a plan to house hundreds of homeless people in temporary shelters in Huntington Beach, Laguna Niguel, and Irvine, after protests from people in those cities.

Protecting its own immigrants and providing housing for its own people shouldn’t be a heavy lift for a wealthy county with 3.2 million people—more than the populations of 21 states. After all, Orange County, the sixth most populous in the United States, is one of the richest jurisdictions on earth, with a GDP greater than that of Greece or Portugal, the best shopping anywhere (from South Coast Plaza to Fashion Island), and pioneering master planned communities. It is a headquarters for Fortune 500 firms and biotech startups. It’s also home to brands that define California style (Oakley and PacSun) and food (In-N-Out), while boasting amenities as awesome as Irvine’s schools, Huntington Beach volleyball, Crystal Cove’s sands, and two Disney parks.

But the recent decisions to abandon the local duty to protect immigrants and the homeless weren’t really news—or even a departure. Orange County has an especially bad case of a California malady: Our local governments simply can’t meet the challenges and standards of our diverse and globally oriented communities. And in no place is the gap in sophistication between government and a locality wider than in Orange County.

“We think of ourselves as Mayberry,” says my friend Fred Smoller, a Chapman University political scientist who is an expert in local government and Orange County, “when we really are closer to Gotham City.”

The Dark Knight’s hometown might seem a strange parallel for a sun-splashed county known for its religiosity, from the late Robert Schuller’s Crystal Cathedral (now headquarters of the Roman Catholic diocese) to Rev. Rick Warren’s Saddleback Church. But the decisions on immigrants and the homeless reflect Orange County’s fundamental confusion about itself.

The protests against housing for the homeless were particularly jarring, with one organizer quoted as suggesting that the county relocate the homeless “maybe somewhere else in California.” The abandonment of the homelessness plan came the same week the county opened a new $35 million, state-of-the-art shelter for animals, complete with air-conditioned kennels. (The city of Irvine, whose residents have fought against a homeless shelter, also recently announced plans for a new animal shelter.)

Fundamentally, this is a county that is lying to itself, and twisting logic into the pretzel shape of its curviest roads. In opposing the immigrant sanctuary laws, the county supervisors portrayed themselves as patriots honoring federal supremacy—even if it means collaborating with the Trump Administration’s punitive mass deportations that are increasingly targeting non-criminals. But in the next breath, as supervisors dropped the homeless plan, they suggested that they were standing up for local sovereignty in the face of demands by the same federal government: A U.S. district judge has pushed the county to address the homeless issue.

In this and other cases, Orange County officials have portrayed themselves as weak, playing the victim. In the immigration case, they saw themselves as the targets of a state somehow bullying them to protect their own immigrants. In the homeless case, the pretense is that Orange County can’t afford to house a few thousand homeless people. In Costa Mesa, where the city council also opposed new housing for the homeless, Councilman Jim Righeimer declared that, “There’s not enough money, anywhere—anywhere—to take care of people who do not want to take care of themselves.”

Cry me a Santa Ana River.

There is another danger of the county’s Mayberry complex. By clinging to its old image as a collection of NIMBY-ish small towns, and by failing to acknowledge that it has become a sprawling, diverse, heavily urbanized region with big city headaches to match its big city amenities, Orange County has made itself profoundly vulnerable to sophisticated mismanagement and persistent corruption.

Two decades ago, local officials seemed powerless to stop treasurer Robert Citron until his bad investments had bankrupted the county. More recently, the county has been unable to build the infrastructure of a major American urban region, most notably failing to develop an international airport.

And the county has consistently failed to confront public official corruption in its law enforcement structure, even after its previous sheriff went to prison. A long-running scandal has shown that both the district attorney’s office and the sheriff’s department “secretly operated unconstitutional scams with jail snitches to win convictions, hid exculpatory evidence from defendants and juries, and, when necessary, committed perjury in hopes of masking the cheating,” as the OC Weekly put it. Judges have condemned the misconduct, which has led so far to the dismissal of 18 cases.

But the district attorney and sheriff haven’t lost their jobs. Instead, these same county law enforcement agencies now claim to be defending California from criminals by siding with the Trump administration’s mass deportation strategies. It’s right to be cynical about this. Is Orange County using the immigration issue to distract from its law enforcement’s own troubles? Or, even worse, are the sheriff and the district attorney trying to curry favor with the federal authorities, and thus blunt federal investigation into their own misconduct?

The county’s Mayberry complex doesn’t just hurt people caught up in the criminal justice system, or the homeless or immigrants. It has given Orange County a government that’s out-of-step with the desires of the people who live there. In a new Chapman University survey of 706 Orange County residents, 83 percent of respondents said they wanted to find a way for undocumented immigrants to stay, and 64 percent said immigrants “contribute more than they take” from the economy. The same poll found that assisting the poor and homeless was the second biggest issue in the county among residents (with 24 percent citing it).

California Democrats have fantasies of turning the historically Republican Orange County into a blue place that will support a statewide progressive agenda. That won’t happen, and it shouldn’t. The poll shows that Orange County’s residents are very much in the middle, disgusted with Washington, D.C. and with both parties, and worried about their kids and the cost of housing and living here.

Ideally, Orange County could pursue a moderate path that is true to its people’s real views, which embody a practical California libertarianism: skeptical of costly regulation while championing entrepreneurialism, immigrants, open government, limits on law enforcement, and preservation of its natural treasures.

But that would take a county with new leadership that thinks in ways as big and beautiful as Orange County itself.

Joe Mathews writes the Connecting California column for Zócalo Public Square.