Ban also condemned a recent wave of Palestinian attacks, which he called "terrorism", and criticised the Israeli blockade against the Hamas-run Gaza Strip.
In a statement alongside Netanyahu at the prime minister's office in Jerusalem, Ban called for efforts to keep the possibility of a two-state solution alive.
While acknowledging the threats facing Israel, Ban said "we must not allow difficulties to become excuses for inaction".
"We cannot ignore key underlying causes of violence: growing Palestinian anger, the paralysis of the peace process, the nearly a half-century of occupation," he added.
Israeli settlement building in the occupied West Bank along with the lack of any progress in peace efforts have helped feed a wave of Palestinian knife, gun and car-ramming attacks since October, many analysts say.
"Stabbings, vehicle rammings and shootings have only one name: terrorism," said Ban.
Violence has declined in recent weeks, though attacks continue to occur, including a shooting spree at a Tel Aviv cafe on June 8 that killed four Israelis.
Ban specifically mentioned the Tel Aviv, but said security measures would not be enough.
"You need a political horizon," he said. "You need a leadership that is committed to peace and a just and a lasting solution."
Despite Ban's comments, the meeting with Netanyahu appeared friendly, with both men thanking each other. It was Ban's 11th visit as secretary general, expected to be his last before leaving office at the end of the year.
Israel, said Netanyahu, "does more to promote and protect human rights and liberal values than any other in the blood-soaked Middle East.
