The attempted coup in Turkey offers a dramatic reminder that even democracies are vulnerable. Yet that nation’s elected leader, President Recep Tayyip Erdogan, has been jailing his critics.

Many people around the world suffer under brutal oppression, and Americans should stand for the freedom of all. While there is no single best political system, any legitimate government must be accountable to those it claims to represent.

Dictatorships should not be viewed as just another cultural affectation warranting respect. Preventing people from choosing their leaders, barring citizens from debating issues, arresting demonstrators protesting state abuses, and punishing the faithful for worshiping the “wrong” god all are violations of people’s most basic rights.

Liberty is not a gift from government, but inherent to the human person. Individuals are morally responsible to choose good. They must be free to make decisions for themselves. Every life has greater value than the grandest political empire.

However, American foreign policy cannot be centered on democracy promotion. The U.S. government is responsible to the American people. It should not risk their lives and take their money except when necessary to protect them—their society, homes, prosperity, and liberties. Military personnel are not gambit pawns to be sacrificed in ivory-tower crusades.

This isn’t to say that advancing Americans’ interests can be separated from concern for others. Moral considerations must shape and limit foreign policy. The mere fact that something, say supporting a friendly dictator, theoretically benefits America does not automatically make it appropriate policy. The U.S. government’s chief responsibility is to protect American citizens, but it should not callously harm others.

This should limit the sort of foreign intervention that unfortunately has become commonplace for Washington. Most of what the U.S. government ​does overseas bears at best a limited relationship to Americans’ interests and rarely protects anything important, let alone vital.

For instance, it was necessary to destroy al-Qaeda and its Taliban host in Afghanistan in 2001. Spending the next 15 years attempting to create a strong and stable central government was not justified. Bringing democracy to Afghanistan was a worthy ideal, but one that could not be imposed, even at high cost.

It’s an important lesson our leaders ​sadly refuse to acknowledge. Even worse today is the Obama administration’s support for the totalitarian monarchy of Saudi Arabia as it wreaks human havoc in Yemen for no obvious purpose. The U.S. government is helping to kill people who have never harmed or even threatened Americans.

Very often the U.S. faces two or more unpalatable choices, in which case the best decision is simply to stay out. For instance, Washington correctly opposed the coup in Turkey. Little good would come from a military takeover. Liberty rarely emerges from a gun barrel; when soldiers start killing civilians, a positive outcome becomes almost impossible.

Nevertheless, U.S. officials cannot embrace President Erdogan, who is becoming a Putinesque figure, maintaining the forms rather than the substance of democracy. The best Washington can do is endorse the democratic process, irrespective of who is supporting or threatening it.

Moreover, American officials should be far more humble in imagining that they have influence, let alone influence for good. For decades the U.S. backed Egypt’s military dictators, first Anwar Sadat and then Hosni Mubarak. Washington convinced itself that brutal “stability” was worth paying billions of dollars for.

When demonstrators threatened Mubarak’s survival, U.S. officials backed him. As his control ebbed, Secretary of State Hillary Clinton ostentatiously shifted against him. When the Islamist Mohammed Morsi was elected president, the Obama administration endorsed him. In no case did the Egyptian people care what Washington thought.

When Morsi was ousted in a military putsch, Washington denied that the coup counted as one under U.S. law. Eventually the administration halted and restarted financial aid, while Secretary of State John Kerry applauded Egyptian generalissimo Abdel Fattah al-Sisi’s nonexistent commitment to democracy. Today tens of thousands of Egyptians languish in prison.

The performance was worse than unprincipled. It was incompetent, even embarrassing. It would have been far better had U.S. officials simply shut up and worked behind the scenes to combat human-rights abuses irrespective of who perpetrated them. Instead, virtually everyone in Egypt now distrusts Washington, an extraordinary “achievement.”

When possible, the U.S. government should encourage respect for human rights. But even when well-meaning, Washington often has created far more harm than good. Better to keep the military at home, while letting Americans outside of government lead the fight for liberty and democracy.

Doug Bandow is a senior fellow at the Cato Institute. A foreign-policy fellow and scholar with Defense Priorities, he is a former special assistant to President Ronald Reagan.