President Reagan told a Jewish service organization yesterday that "the United States and Israel stand forever united" in the task of providing "permanent security" for Israel, and he claimed that the U.S. military buildup during his administration has made Israel more secure.

"Today the United States has stopped wringing its hands apologetically and once again begun to play its rightful role in the world -- with faith, confidence and courage," Reagan said. "And that means Israel can depend on us."

In a campaign speech to the B'nai B'rith international convention here, the president said that peace in the Middle East is closer than when he took office.

"When I spoke to you four years ago, peace was eluding the Middle East," Reagan said. "It still does. But now we and the state of Israel have far greater cause for hope."

Reagan did not mention Israel's rejection of his Middle East peace plan, which remains stalled after two years. Nor did he discuss other U.S. difficulties in the Middle East, which has proved both a military and diplomatic troublespot for his administration.

In his 1980 speech to the organization, Reagan charged that the "weak and confused leadership of Jimmy Carter" had placed Israel in "grave danger" and had encouraged terrorism.

Reagan echoed that assertion yesterday when he referred to the "weak and muddled" leadership of the Carter administration, which he said reached a low point on March 1, 1980, when the United States voted in the United Nations for a resolution condemning Israel.

"Some 48 hours later, President Carter disavowed the vote, announcing to the press that it had all been a mistake, a bad mistake," Reagan said. "And it certainly had."

Reagan said that the United Nations "has too often allowed itself to become a forum for the defamation of Israel" and repeated a pledge that the United States would walk out of the international organization if it ever expelled Israel.

Appearing on the same podium that Democratic challenger Walter F. Mondale had occupied three hours earlier, Reagan suggested that Israel would be safer, and the U.S.-Israeli alliance more secure, if he is reelected.

Reagan never mentioned Mondale by name, and the president's managers did not alter the thrust of the speech to answer Mondale's charges that recent comments by Reagan linking politics and religion have breached the wall of separation between church and state. Reagan strategists believe that the president's high card with the Jewish community is long support of Israel, which he has backed since the formation of the Jewish state in 1948.

In the 1980 election, Reagan made a strong showing in the traditionally Democratic Jewish community following a similar strategy. A CBS-New York Times Poll gave Carter 45 percent of the Jewish vote, Reagan 39 percent and independent candidate John B. Anderson 15 percent. In 1976, Carter won nearly two-thirds of the vote among Jews.

Reagan was applauded warmly several times yesterday, particularly when he reaffirmed his support for an international treaty against genocide. The treaty, which the United States has never ratified and which Reagan declined to support until Wednesday, has been bottled up in the Senate for 35 years.

The president acknowledged that he had taken "a cautious view" toward the issue, "in part due to the human-rights abuses performed by some nations that have already ratified the documents . . . . " But Reagan said he now will "vigorously support" ratification.

"And I want you to know that we intend to use the convention [against genocide] in our efforts to expand human freedom and fight human-rights abuses around the world," Reagan said. "Like you, I say in a forthright voice, 'Never again.' "

The phrase is a reference to the Holocaust, the Nazi extermination of much of the Jewish population of Europe during World War II.

Reagan yesterday linked his support for "the free nations" in Central America with his opposition to anti-Semitism. He quoted from a Jewish refugee from Nicaragua, Isaac Stavisky, who said that the country's leftist Sandinista regime had discriminated against Jews, confiscated their property and forced them into exile.

Reagan said that U.S. politicians who "take a position of weakness" in Central America "would give free rein to Marxist-Leninists who would persecute Central American Catholics and Jews, leaving them defenseless against Sandinista intolerance."

The president said his administration had strengthened the U.S.-Israeli alliance by adopting a "formal strategic relationship" with Israel, cooperating in military research and procurement, increasing economic assistance and undertaking negotiations for a trade agreement to open the markets of the two nations to each other's goods.

"These measures have made our relations with Israel closer, and our friendship stronger, than at any time in the history of our two nations," Reagan said.