Spanish lawmakers on Thursday backed a law granting citizenship to tens of thousands of Western Saharans who were born when Spain ran the disputed territory now largely controlled by Morocco.