Residents of Palestinian villages near the proposed route said that the 6km long steel and concrete fence would prevent them from reaching their crops when it cuts into the West Bank to take in a Jewish settlement bloc.
The court said they could appeal again if arrangements for farmers to reach their crops through passages controlled by the Israeli military proved unsatisfactory.
“The Israelis have, in fact, decided to imprison us in one big cage and surround us,” Abd al-Rahim Nitani, a resident of the Palestinian village of Um al-Tin near the three settlements, told the Israeli website YNetnews.
In its ruling, the court cited security considerations and said the three settlements at the centre of the case – Emanuel, Maale Shomron and Karnei Shomron – had been “targets of harsh terror attacks over recent years”.
The International Court of Justice, in a non-binding advisory opinion in 2004, ruled the construction of the barrier on occupied land was illegal and should be stopped immediately.
Emanuel is located 18km inside the West Bank near the Palestinian city of Nablus. Maale Shomron and Karnei Shomron are slightly closer to Israel.
Around 240,000 Jewish settlers live in the West Bank among 2.4 million Palestinians.
Israel began building what is to be a 670km long barrier in the West Bank in 2002, describing it as a security measure to stop suicide bombers from infiltrating its cities.
About a third of the network of razor wire-tipped fences and towering concrete walls has been completed and Israeli officials say the project has already stopped several attacks.
Palestinians say it is a move a move to seize land that Israel has occupied since the 1967 Middle East war and will deny them the viable state they want in the West Bank and Gaza Strip.