The Biden administration recently made two grim announcements: Iran is helping to manufacture drones for Russia. China operates a spy base in Cuba.

The message is clear: America’s foes are joining forces. They now constitute what Washington’s influential Center for a New American Security recently called a new “axis of authoritarians,” which threatens U.S. interests from East Asia to the Caribbean and Eastern Europe to the Persian Gulf. The phrase implies that what binds the governments of Russia, China, Iran and Cuba is their common aversion to democracy. For a Washington foreign-policy class that often depicts America’s geopolitical struggles as contests between freedom and tyranny, it’s an appealing narrative.

But there’s a problem. Only a few years ago, the governments of Cuba and Iran — which had the same authoritarian political systems back then — were pursuing closer ties to Washington. They didn’t swerve toward Russia and China because they realized they hate democracy. They swerved because the United States spurned those overtures and drove them into the arms of America’s great-power foes. Under both former President Donald Trump and President Biden, Washington has helped create the very anti-American partnerships it now bemoans, which is exactly what it did during the last Cold War.

Take Cuba. For most of the post-Cold War era, its government’s strategy had been fairly clear: keep its political system closed while opening the economy to foreign investment. That required better relations with Washington, since U.S. sanctions not only barred Cuba from its biggest potential source of tourism and trade but also scared off European companies. William LeoGrande, a Latin America expert at American University, told me, “Every major component of Cuba’s economic strategy in the last two decades had been premised on long-term expectations that the relationship with the U.S. would improve.”

In 2014, that bet began to pay off. The Obama administration announced an end to America’s decades-long enmity with the Cuban government, and soon everyone from Conan O’Brien to Andrew Cuomo to Steve Nash began showing up in Havana. As a University of Miami Cuba expert, Michael J. Bustamante, noted at the time, “the American flag has even become the most stylish national standard, appearing on Cubans’ T-shirts, tights and tank tops.”

Then Mr. Trump entered the White House and it all fell apart. In 2019, he imposed the harshest economic sanctions in more than a half-century. A month later, Cuba began rationing soap, eggs, rice and beans. Around that same time, according to The Wall Street Journal, China’s surveillance network on the island “underwent a significant upgrade” (the Cuban and Chinese foreign ministries have denied reports of a Chinese surveillance facility in Cuba). Evan Ellis, a Latin America analyst at the U.S. Army War College, told The Journal that the deal “is basically Chinese pay-to-play,” adding that “China gives money to Cuba it desperately needs, and China gets access to the listening facility.” Last fall, China agreed to restructure Cuba’s debt and donate $100 million to the island. One reason Cuba still needs Beijing’s money is that the Biden administration has kept key Trump sanctions in place.

U.S.-Iran relations follow a similar pattern. When the two countries signed the 2015 nuclear deal, Iran’s foreign minister at the time, Mohammad Javad Zarif, called it “not a ceiling but a solid foundation. We must now begin to build on it.” Iran’s leaders, like Cuba’s, hoped better relations with the United States would spur Western investment. Although some Iranian hard-liners feared that economic ties to the West would weaken the regime, Mr. Zarif and President Hassan Rouhani gambled that a stronger economy would strengthen Iran’s regional position and defuse popular discontent, thus helping solidify the country’s despotic political system.

It didn’t work out that way. Mr. Trump canceled the nuclear deal and reimposed harsh sanctions. Rather than re-enter the agreement on its first day in office, the Biden administration made additional demands, which helped thwart efforts to revive the deal. And as the prospect of substantial U.S. and European investment disappeared, so did Washington’s leverage over Iran’s relationship with Moscow. Iran now has little to lose by developing what a National Security Council spokesman recently called a “full-scale defense partnership” with Russia.

This isn’t the first time the United States has driven smaller nations into the arms of its superpower adversaries. It did so during the Cold War. In his book “Embers of War,” Fredrik Logevall notes that until the late 1940s, Ho Chi Minh, the Vietnamese nationalist leader, believed the United States “could be the champion of his cause” of independence from France. During World War II, Mr. Ho’s rebel army, the Viet Minh, worked alongside the Office of Strategic Services, the precursor of the C.I.A., in America’s fight against Japan.

But as Cold War tensions rose, the Truman administration disregarded its Asia experts — many of whom considered the Viet Minh a primarily nationalist rather than Communist movement — and backed French efforts to preserve its empire. By 1950, the Viet Minh were receiving arms from Communist China.

A decade later, the United States did something similar in Cuba. After taking power at the beginning of 1959, Fidel Castro set about redistributing wealth and revising the island’s historically subservient relationship with Washington. But despite Mr. Castro’s leftist inclinations, Mr. LeoGrande and Peter Kornbluh note in their book, “Back Channel to Cuba,” he “showed no special affinity for the Soviet Union during his first year in power.” It was only after Mr. Castro nationalized large plantations, which led the Eisenhower administration to begin plotting his overthrow, that Havana grew dependent on Moscow for economic and military assistance. U.S. animosity, the Soviet leader Nikita Khrushchev observed, pushed Cuba toward the U.S.S.R. “like an iron filing to a magnet.”

The Cold War should remind us that countries with similar political systems aren’t necessarily allies. During the Cold War, many U.S. policymakers doubted that Communist governments could remain independent of the U.S.S.R. But that’s exactly what happened in Yugoslavia, where Josip Broz Tito split with the Soviet Union in 1948 and later welcomed U.S. aid. In the 1960s, the Soviet Union and China became adversaries themselves.

If even governments that shared a common Marxist ideology didn’t always get along, there’s even less reason to believe that the diverse forms of tyranny practiced in China, Russia, Iran and Cuba constitute binding glue today. There’s nothing ideologically predestined about the growing security or military ties between Havana and Beijing or Tehran and Moscow. They stem, in large measure, from Washington’s efforts to starve Cuba and Iran into submission rather than forge working relationships with regimes whose political systems and foreign policy orientations we dislike.

These days, hawks in Washington say the United States cannot lift broad-based sanctions on Iran and Cuba, even though they deny ordinary people food and medicine, because the two countries are partnering with America’s enemies. Maybe the hawks should have thought of that before they brokered those partnerships in the first place.