I wouldn't say that a society has a moral duty to even accept immigrants. I am one and am eternally grateful that I get to live in Canada.
But take a country like Japan - they have near zero immigrants and they seem to like that.
If you have an open society with a flexible identity like the US, Canada, Australia, and maybe others, then you get the benefit of ambitious immigrants coming to grow your economy. But this isn't doable by or desirable to every other nation.