Richard V. Allen resigned under pressure yesterday and President Reagan replaced him as White House national security adviser with Deputy Secretary of State William P. Clark.

Clark will have greatly expanded powers in a reorganized White House national security structure that, in effect, removes presidential counselor Edwin Meese III from direct control over foreign policy formulation.

The end of Allen's drawn-out ordeal, which began in early November when it was revealed that he had taken from Japanese journalists $1,000 meant as an honorarium for Nancy Reagan, came swiftly after Reagan's return from a California holiday. Allen resigned the same day he was cleared of all suggestions of wrongdoing, demonstrating that Reagan and his top advisers wanted Allen out regardless of the official findings concerning his conduct.

Earlier, the Justice Department had cleared Allen of any violations of law. The White House counsel's office cleared him yesterday of any breaches of White House standards of conduct, finding that despite potential appearances of conflict of interest, Allen was guilty of no violations.

Although Allen had insisted until yesterday that he would not resign, he changed his mind after being summoned to the Oval Office for a meeting with Reagan that began about 2 p.m. Allen was alone with Reagan for only a few minutes, then they were joined by Meese, according to White House deputy press secretary Larry Speakes.

When Allen emerged from the 25-minute session he met with White House chief of staff James A. Baker III, with Meese and then with members of the National Security Council. Baker was one of the first White House officials to decide that Allen should leave because he had embarrassed the administration. Meese was Allen's last high-level defender, but he, too, came to favor Allen's departure.

No hint of any problems, embarrassment or controversy marred the flowery and generous tone of the brief letters Reagan and Allen exchanged. Reagan expressed "deep regret" at losing the aide he pushed aside, and Allen hailed the "rare privilege" of serving Reagan and wished him well in his "historic presidency."

Allen accepted Reagan's offer of a part-time post as the president's consultant "for an indefinite period" to help organize the President's Foreign Intelligence Advisory Board, which will oversee U.S. intelligence agencies' performance. Allen will get $190 for each day he works in this capacity, White house communications director David Gergen said. Allen presumably will resume his private consulting career at the same time.

At bottom, it was evident that Allen lost his battle to stay in the White House because his performance had not won him the admiring support that saved another Reagan aide who got into trouble, Office of Management and Budget Director David A. Stockman.

Reagan wrote that Allen served "with great distinction," but there were many officials inside and outside the White House who had come to think that the foreign policy structure needed to be revised and needed better coordination than Allen could provide.

Allen told reporters, who awaited him when he returned to his Arlington home from the White House, that "politics was involved" in his resignation.

Allen said he thought it "unusual" that someone who had been cleared by "a rigorous and meticulous examination" could "find himself in a position where his resignation would be submitted and accepted."

Allen left the White House by a side entrance to avoid a crowd of reporters; he left it to Speakes and Clark to announce the changes.

The announcement read by Speakes explained the expanded role of the new national security adviser, saying that Clark "will be responsible for the development, coordination and implementation of national security policy, as approved by the president."

Clark said he will brief Reagan daily, or more frequently if the situation requires it.

He made clear the shift in Meese's duties by explaining that although Meese remains the counselor to the president for both domestic and foreign issues, he will take a hand in foreign policy matters only when they have an impact on domestic issues, "to resolve any conflict between the foreign and domestic sides."

However, Clark said he hopes that Meese usually will be present when he briefs the president, noting that he has known Meese for 16 years. Clark was Reagan's first chief of staff in the California governor's office and recruited Meese and White House deputy chief of staff Michael K. Deaver to work for Reagan, who appointed Clark to a series of judgeships.

Clark left a seat on the California Supreme Court to come to Washington as deputy secretary of state.

He said he set no preconditions for accepting the national security post and does not expect to play a large role as a public spokesman for the president on foreign policy matters.

Clark played a role in the administration's review of its foreign policy structure that led to the expansion of the national security adviser's authority.

Defense Secretary Caspar W. Weinberger was influential in persuading the president that the system needed to be changed, according to well-informed sources. Former national security adviser and secretary of state Henry A. Kissinger was among those consulted during the review.

It was a fear of repeating the experience of the years in which strong advisers in the White House such as Kissinger feuded with the secretary of state that led Reagan to downgrade Allen's role at the outset of his administration. Now the president is going back to the pattern he sought to avoid, but with one important difference. Clark, unlike Kissinger or Zbigniew Brzezinski, is not a foreign policy expert.

He drew considerable criticism at his Senate confirmation hearings for the No. 2 job at State when he could not name the leaders of Zimbabwe or South Africa nor answer a series of other questions. At State, however, he has been praised for learning quickly. Upon being questioned by a reporter yesterday, Clark replied with quiet good humor that he knows that Robert Mugabe is Zimbabwe's prime minister and has met with him.

Clark begins his new duties immediately and said he expects to spend most of his time in his new White House office, but will keep his State Department hat until his successor is close to winning Senate confirmation.

Speculation about his successor centered on Lawrence S. Eagleburger, assistant secretary of state for European affairs. Eagleburger has been planning to leave the government for a higher-paying job in private industry, but it was thought he might stay if offered Clark's job. Assistant Secretary of State James L. Buckley also was mentioned as a candidate to succeed Clark.

Allen's conduct was reviewed by Richard A. Hauser of the White House counsel's office. The review found that in taking the $1,000 honorarium, and ordering it placed in a safe where he forgot about it for eight months, Allen committed an "oversight" that did not violate standards of conduct.

When he received three watches from longtime Japanese friends and business associates, Allen had reason to believe the watches were personal gifts. The receipt of one watch which "may have been delivered to Mr. Allen after Jan. 20, 1981," the review concluded "created, at the very worst, a potential appearance problem which, in retrospect, would suggest that the more prudent, although not required, course would have been not to accept the watch." The review found no violation in connection with the watches, however.

The review also found no violations in Allen's sale of his consulting firm, Potomac International Corp., to former Reagan speech writer Peter Hannaford, his contacts with Potomac clients after taking on his White House job, or the errors and omissions on his financial disclosure report.