A sovereign country cannot, by definition dictate to another what their immigration policy should be. Just as each individual has the right to discriminate on whatever basis they choose, so too, a sovereign country can allow immigration, or to ban it, based on whatever terms they choose - racial, religious, marital, national, age based or any other. Any suggestion otherwise is to deny the country's sovereignty.
Choosing immigrants is a bit like choosing housemates in a group house. Typically newcomers are chosen which bring the greatest benefit to the existing inhabitants - those with the highest and most beneficial skills, and the lowest likelihood of committing crimes.
See