He didn't. Although this quote is often misattributed to Benn, including recently in the House of Commons itself by Bell Ribero-Addy MP (Hansard), the quote actually comes from the Scottish journalist and writer Neal Ascherson.
Writing for the Independent in January 1996, Ascherson describes his take on the al-Masari affair in an article entitled If we teach children morality, what will we say about the arms trade?.
The al-Masari affair overflows in all directions with moral
relativism. My own view is that to expel a political asylum-seeker
because his country threatens to cancel business contracts with
Britain is absolutely wrong. And it is not only wrong but dangerous in
the long term to us all. This is because of one of the Laws of
Politics that I wrote long ago into my little black notebook: "The way
a state treats its aliens is the way it would treat its own subjects
if it dared".
Ascherson was subsequently paraphrased in the Guardian by Francis Wheen, who wrote in 1999:
We should always watch how politicians treat refugees, Neal Ascherson
once wrote, because that's how they would treat the rest of us if they
thought they could get away with it.
This seems to be where the more recent framing of the quote has come from.
As for what the al-Masari affair refers to; Mohammad al-Masari is a Saudi political dissident who fled Saudi Arabia in 1993, and sought asylum in the UK. He successfully fought against the British government's attempts to deport him in 1996. This is the context in which Ascherson presented the quote, although as the above excerpt shows, he had come up with it long beforehand.
Note: For some reason, the Independent's website shows a 2011 timestamp on the digitised article. The article is visible, however, in their Jan 21st 1996 archive.