"a town which bordered the school and which was exclusively populated by immigrants"
I didn't put the second which in at first, and then felt it was necessary. Can anyone enlighten?
If what you want is to avoid the double "which" – it is not wrong but it is unaesthetic to many – you have several options. You could go, "The town bordering the school, which is (etc.)" or turn it around as "The town, exclusively populated by immigrants, bordered the school", or do yet other things along the same lines.
Though what seems a little odd to me is a town bordering a school, it almost sounds as if the school is bigger than the town. If you have previously discussed the school and now want to say something about the town, however, that objection lapses. Even so, I would prefer something with "neighbouring".