Actually, I think Posner's position is backwards and untenable in a modern globalized context. If we assume that human rights must be respected regardless of nationality, then national borders must be subservient to human rights.
Reading the universal declaration of human rights, these articles jump out at me for specifically this context:
Article 6: Everyone has the right to recognition everywhere as a person before the law.
Therefore, you cannot exclude people from due process because they are foreigners.
Article 7: All are equal before the law and are entitled without any discrimination to equal protection of the law.
Therefore, you cannot have one kind of due process for your own people, and another kind for foreigners.
Article 12: No one shall be subjected to arbitrary interference with his privacy, family, home or correspondence, nor to attacks upon his honour and reputation. Everyone has the right to the protection of the law against such interference or attacks.
Therefore, the U.S. system of law is obligated to protect foreigners from undue interference by the NSA, to an equal degree as U.S. citizens are protected.
Now, you can say that the human rights declaration is just a bunch of words without legal weight, and that in a realpolitik context it's simply impossible to give everyone their human rights in the current world even if you wanted to. And you would be right. When you read the UDHR it is depressing how far we have to go. But ... on this point, at this time, we can make genuine progress. So, why not? If what the NSA is doing is wrong when applied to U.S. citizens, it is wrong when applied to foreigners.
In the long run, people like Posner will be viewed as those who held back the tide of progress. The social struggle for equal human rights for all is not done, and it won't be for centuries, but you definitely want to be at the right side of history at each inflection point, and this is one of them.