Navy Secretary James H. Webb Jr. sent a scathing, top-secret memorandum to Defense Secretary Caspar W. Weinberger in July questioning the U.S. military buildup in the Persian Gulf, The Miami Herald has learned.

Webb wrote the memo to summarize his concerns about the Reagan administration's policy of escorting reflagged Kuwaiti tankers through the war-torn area after he had unsuccessfully opposed the buildup during discussions in the Pentagon.

His memo argued that U.S. forces should not be committed to the Persian Gulf without a clear military objective, support from the American public and strategic cooperation from allies in the region, according to sources who have read the memo. They said Webb felt those requirements had not been met.

One source said the thrust of the document was to ask Weinberger: "When do we know we have won?" A second source, a high-ranking Pentagon official, said the effect was to challenge Weinberger to explain: "What are our objectives? When do we know we have achieved our objectives?"

The Pentagon official said the memo argued that the military effort to keep the sea lanes open should involve U.S. allies and other countries in the region and that the United States should play a less prominent role.

Weinberger responded with a memo, described by one of the sources as a terse rebuttal, that said the United States achieved a victory every time a commercial ship passed safely through the gulf.

"It came across almost as a reprimand" urging Webb to become a team player and support the policy, the source said.

Webb has avoided public comment on the policy. He has turned down numerous requests for interviews "in order not to embarrass the administration or Weinberger," the source said.

Weinberger could not be reached for comment. Robert B. Sims, Weinberger's assistant secretary of defense for public affairs, said, "I don't have any reason to think he {Webb} does not support the president's position in the Persian Gulf."

Asked if he knew whether Webb opposed the policy, Sims said, "I think you better get it from him."

Webb wrote his memo the same month the Bridgeton, the first tanker escorted through the gulf, was damaged by a mine and two months after the Navy frigate Stark was hit by an Iraqi missile, killing 37 American sailors. Both incidents embarrassed the Navy.