Former president Jimmy Carter told an Israeli audience tonight that Middle East diplomacy must seek "not just security" but justice and be mindful of the aspirations of the Palestinian Arabs of the West Bank and Gaza Strip "who are dependent on you for their own justice and peace."

In carefully chosen words to several hundred people at Tel Aviv University, where he was awarded an honorary doctorate in philosophy, Carter underscored his differences with the policies of the government of Prime Minister Menachem Begin over the occupied territories.

He said United Nations Resolution 242, which was adopted after the 1967 war and called for Israel to return territories captured in the war as part of a peace settlement, remains "the only basis for peace" in the region.

Carter said this formula was at the heart of the Camp David peace accords he negotiated with Begin and the late president Anwar Sadat of Egypt in 1978, and he reiterated his support for President Reagan's Middle East peace initiative as consistent with the Camp David formula.

"He and I don't agree on many things," Carter said of his successor, "but this is one thing we do agree on."

The Begin government, while proclaiming its strict adherence to the Camp David accords, has ruled out the possibility of ever surrendering any portion of the West Bank and Gaza as part of a peace agreement. It has seized on the Camp David formula of "autonomy" for the Arabs, envisaged in the agreement as an interim five-year arrangement, as the only possible result of the process. Begin also has rejected the Reagan plan as a violation of the Camp David accords.

Both tonight and yesterday, in remarks to an Arab audience in Bethlehem, Carter voiced his differences with Begin in careful, diplomatic language. He is visiting as a guest of the Israeli government.

West Bank Arabs continued protests started yesterday against Carter's visit to Israel. Israeli radio said soldiers used tear gas to disperse rock-throwing students and closed schools in four towns.

Before calling for "justice" for the West Bank and Gaza Arabs tonight, Carter reiterated his support for Israel in the kind of terms he did not use as president. Referring to "my deep religious beliefs" as a devout Southern Baptist, Carter said he believed that "God ordered and ordained the existence of the state of Israel as a permanent homeland for the Jews."

Carter was honored by Tel Aviv University both as architect of the Camp David accords and as a visiting professor from Emory University in Atlanta, where the former president has established the Carter Center for the study of the resolution of international conflicts. Tel Aviv University officials announced they were establishing a "Jimmy Carter distinguished lectureship" at the university.