A US judge has ruled that students at the University of Maryland have the right to hold an interfaith vigil to honour lives lost in Israel's war on Gaza.