Maj. Gen. John K. Singlaub yesterday agreed to retire after Army leaders summoned him to the Pentagon to explain his second public attack on President Carter's defense policies.

Singlaub, who was ordered home from Korea last year to tell Carter personally why he publicly criticized the Korean troop withdrawal plan, said Thursday it was "ridiculous" for the president to postpone production of the neutron warhead without "some compensating concession from the other side."

The Army general, in remarks before ROTC cadets at Georgia Tech, also called the recently approved Panama Canal treaties "unnecessary" and said Paul C. Warnke, director of the Arms Control and Disarmament Agency, "has adovcated over the years unilateral disarmament."

"The SALT (strategic arms limitation talks) have been in trouble since Mr. Warnke was put in charge of them," Singlaub told the cadets.

The 56-year-old general, who has neen in the Army for 35 years, put both the neutron warhead and B1 decisions by Carter in the "ridiculous" category.

"I think the decision not to produce the neutron bomb without some compensating concession from the other side is like throwing your trump card away in a game of bridge. I think it's ridiculous. I put the B1 bomber in the same category," he told the cadets.

Carter canceled production of the B1 bomber last year and opted instead for building cruise missiles.

Singlaub, chief of staff at the Army Forces Command at Fort McPherson, Ga., was ordered on Thursday to fly to Washington after word of his remarks reached his superiors at he Pentagon.

The general was "led to believe by the people who arranged for the speech that it was to be an off-the-record, academic enviroment," said Col. Harry Heath, chieft of public information at Fort McPherson. Although a television camera was at the meeting, Heath said the general was 'not aware" news media were present.

Singlaub met in the Pentagon yesterday morning with Army Secretary Clifford L. Alexander and Gen. Bernard W. Rogers, Army chief of staff, according to Brig. Gen. Robert Solomon, Amry chief of information.

Atthat meeting, said Solomon, Singlaub "agreed to retire," although the date has not been set. Solomon said Gen. Frederick J. Kroesen, commander of Forces Command and thus Singlub's boos, had recommended to Alexander and Rogers that Singlaub "be permitted to retire."

At the White House yesterday, spokesman Rex Granum said Carter was in the position of "having been advised" of Singlaub's retirement rather than of "initiating it." Carter could have rejected the retirement recommendation, Granum noted.

After Singlaub got in trouble last May for criticizing Carter's plan to withdraw troops from Korea, Gen. George S. Brown, chairman of the Joint Chiefts of Staff, told a group of civilians visiting the Pentagon that the rules against active duty military officers speaking out against presidential decisions are "perfectly clear."

Brown said military officers can give their personal opinions to Congress when asked for them, but once the president makes his decision, officers are not free to criticize it publicly unless they want to "hand up their suit" and voice their opposition as private citizen.

Singlaub's previous dressing down by his superiors in Washington stemmed from remarks he made during an interview with Washington Post correspondent John Saar.

"If we withdraw our ground forces on the schedule suggested," Singlaub siad in the interview printed May 19, "it will lead to war." Singlaub at the time was chief of staff of the American military command in South Korea.

Singlaub, in testifying before the House Armed Services Committee May 25, did not back away from the quote but said the context of his remarks was the South Korean commanders believed American withdrawal would lead to war and he agreed with them.

Singlaub knew of Carter's withdrawal decision when he spoke out against it, said Defense Secretary Harold Brown at the time. "Because he knew and expressed an opinion different from that policy," Secretary Brown said, it "became impossible" to keep him in Korea as chief of staff.

Carter said than Singlaub was being transferred to the Fort McPherson job and "was not being chastized or punished" for his public criticism of the Korean troop withdrawal plan.But, said the president, Singlaub's remarks amounted to "an invitation to North Korea."

Carter since has decided to slow down the withdrawals that prompted Singlaub to speak out.

Singlaub, a native of Independence, Calif., and a highly decorated soldier, is eligible for annual retirement pay of $31,455. His combat wounds may qualify him for disability benefits as well.