Some of the Israeli prime minister’s coalition partners backed an opposition motion over rules that exempt most religious students from serving in the military.