WASHINGTON — The carnage of the Syrian government’s assault on Aleppo, enabled by Russia and Iran, was unbearable to watch. Just as unbearable was the realization that the United States could not save the Syrian people from this horror.

That’s hard to admit, and harder for those in the middle of this humanitarian nightmare to hear. But the lessons of how Syria arrived at this moment of catastrophe, and how America arrived at this moment of helplessness, are clear. And if the United States does not learn from them, we will repeat them.

The first lessons come from our short-term mistakes, which have prolonged the conflict and misery and increased the human toll of the war. Civil wars tend to end by one of three means: One side eventually crushes the other; both sides fight so long that they reach the point of exhaustion; or an outside power steps in with overwhelming influence to force a settlement between the sides.

We most likely watched the first scenario play out when the army of Syria’s president, Bashar al-Assad, together with Iranian militias and Russian forces, stormed Aleppo. Our primary mistake was miscalculating the lengths that Mr. Assad’s allies would go to prop up his rule, while believing our halfhearted measures would be enough to tip the balance. 

The United States was never prepared to do enough to topple Mr. Assad. That was clear when concern over getting dragged into the conflict led both Republicans and Democrats to overwhelmingly oppose President Obama’s request for congressional approval of a limited bombing campaign to respond to chemical weapons attacks on rebel-held areas by the Syrian government.

I was an early leader in the effort in Congress to oppose war against Mr. Assad. I stand by my belief that — had the United States decisively entered the war — Syria would have become a bloody quagmire, with far more death and ruin than we’ve just witnessed in Aleppo. An American invasion of Syria would have made the last 13 years in Iraq look tame.

Instead, the United States pursued a policy that prolonged the conflict. We dropped a lot of bombs inside Syria, but only on Islamic State targets, never in government-controlled areas. We trained fighters in a mess of well-meaning but uncoordinated covert and overt programs run by different parts of our national security apparatus.

We sent weapons to the rebels, but always stopped short of giving them firepower that would have made the difference — in part, because we were justifiably afraid that powerful weapons would fall into the wrong hands. Our halfway support for the rebels doomed them: They had enough to continue the fight, but not enough to win or force Mr. Assad to the negotiating table.

And when Syrians started to flee their country, we compounded our errors by shutting our doors. Unconscionably, the Republican-controlled Congress refused to allow large numbers of Syrian refugees into America because of bigoted fears of domestic extremism. We played right into the jihadist narrative that says America doesn’t care about the suffering of Muslims, and turned our backs when the world needed us most.

The doctors’ precept “first, do no harm” applies to foreign policy as well as medicine. Bashar al-Assad is an evil man. The mayhem and misery he has caused is horrific and indefensible. But American policy since 2013 has made the situation inside Syria worse, not better.

Even after Iraq, American foreign policy and military elites still cling to the notion that military intervention can bring political stability, somehow, to the Middle East. This is a fallacy.

Restraint in the face of evil is hard stuff, but hubris in the face of evil is worse. The United States never should have taken sides in the Syrian civil war. If we had shown restraint from the outset, more people would be alive today.

The real question is how to stop societies from descending into civil war in the first place. This is the most important foreign policy question facing the next Congress. The response must start with a recognition that a foreign policy built on brute military strength alone holds few answers for societies caught in a downward spiral.

Take Jordan and Lebanon, fragile islands of stability in the Middle East today. Increased American assistance could be the difference between those two nations surviving as functioning states and sliding into a Syria-like chaos. The financial support Jordan and Lebanon need to remain economically viable is a drop in the bucket compared to the cost if either one descended into civil strife.

Seven decades ago, amid the rubble of World War II, the United States understood the value of spending money to repair economies, democracies and civil societies. That commitment to funding the building blocks of peace has disappeared. In 1949, the United States spent 3 percent of its gross domestic product on this type of foreign assistance. Today, that number is about two tenths of a percentage point, a 93 percent reduction.

To use another illustration: Today, the Defense Department has more military band members than the State Department has diplomats.

A new Marshall Plan for at-risk countries and regions will not guarantee global security. It took Europe more than 1,500 years after the fall of the Roman Empire to establish peaceful coexistence. In the Middle East, it’s been just 100 years since the Ottoman Empire fell, and the region has not yet found its way to a new order.

But what the United States is doing — using its military to try to bring about political change — isn’t working. Restraint can feel counterintuitive, even cruel, but the alternative is doomed to failure at a far more cruel cost. The most humane, and effective, policy is to spend money up front to prevent catastrophe.