Israel did itself no public relations favors when it enacted a law March 6 that bans foreigners who are public advocates of the boycott, divestment and sanctions movement from visiting the country.

Criticism came from some Jewish organizations, including the Union for Reform Judaism and the Anti-Defamation League, and from such media organizations as The New York Times. All argued that Israel was undermining its own democratic ideals by stifling dissent, particularly regarding settlements.

But that backlash distorts what BDS is.

The first sentence of the negative New York Times editorial is the perfect — and, because of its reach outside the Jewish community, the most damaging — example of that distortion: “A new Israeli law … will bar entry to any foreigner who supports the B.D.S. movement (boycott, divestment and sanctions) against Israel for its occupation of the West Bank.”

The BDS movement, of course, is not about the “occupation of the West Bank.” It’s about the Jewish “occupation” of any land between the Jordan and the Mediterranean — with the goal of the delegitimization and elimination of Israel as the homeland of the Jewish people.

Thus, a law addressing non-Israeli advocates of the BDS movement isn’t a simple free-speech issue, nor is it a matter of silencing dissent. It’s about a sovereign nation choosing not to welcome people who seek its destruction.

Israel has not outlawed pro-BDS donations or speech. As an actual liberal democracy, Israel is not silencing or limiting its own citizens at all.

But a nation has no responsibility to protect the civil liberties of foreigners. It has every right to just say no to admitting anyone who has said or done anything perceived as a threat to that nation.

We’re not arguing that it was smart of Israel to pass this law. As the criticism of the measure shows, it plays into the hands of Israel’s enemies by giving them another stick with which to bash the nation and another opportunity to draw a picture of an alternate reality in which Israel is just like the many oppressive, authoritarian nations around it.

The law also makes Israel appear scared of BDS, which could recharge a movement that has made no concrete progress toward the establishment of a Palestinian state, let alone the destruction of Israel, in more than a decade of insidious efforts.

As the Israel Action Network’s Max Chamovitz said during a visit to Atlanta, some BDS supporters are open to having their minds changed when they see the reality on the ground and realize that BDS not only harms Arabs, but also makes peace less likely. If this law bars some of those people from visiting Israel or deters them from even trying, it will harm the nation it’s supposed to protect.

In a perfect world, Israel would let its foes as well as its friends visit and spend their money, thus supporting Israel’s economy and its future. But in a perfect world, the only nation-state of the Jewish people wouldn’t face so many people, institutions and nations dedicated to its destruction.

We can’t blame Israel for being more than a little defensive. We can blame American organizations for their offensive obsession with lecturing Israel for falling short of perfection in one of the least perfect regions of our imperfect world.