After two military incidents with foes of the United States over disputed border areas, Secretary of State Alexander M. Haig Jr. said yesterday that "as the leader of the free world" the United States is obliged to be a strong advocate of adherence to accepted rules of international law.

Haig said he would let others decide whether pursuing such a policy is a hardening of the U.S. stance.

He brushed aside yesterday's denial by the North Koreans that they had fired a missile at an American spy plane, and described the incident as one in a long series of clashes near the demilitarized zone separating the two Koreas.

At a news conference Haig deliberately declined a reporter's invitation to portray the recent incidents involving U.S. planes with Libya and North Korea as efforts to test the Reagan administration.

It was only one of several occasions when Haig turned away from opportunities to use hard-line language certain to generate headlines around the world. Haig joked at one point that a reporter was searching for a good headline to enliven the news on an August Friday.

During his 39-minute question-and-answer session in the State Department, Haig also accused leftist guerrillas in El Salvador of "resorting to straight terrorism" that made civilians their main victims. He said there has been a steady increase in guerrilla activity, and warned that the United States is considering "a whole array of political, economic and security-related measures" in an effort to halt the flow of Soviet arms to El Salvador through Cuba.

The administration is studying "a number of measures involving the problem at its source, Cuba," Haig said. He declined to explain what any of the security-related" measures under consideration are.

The secretary said he will discuss Soviet arms shipments to El Salvador with Soviet Foreign Minister Andrei F. Gromyko when they hold their first meeting late next month in New York.

On Poland, Haig cautioned that he could not predict what will happen, but indicated that he thinks the chances of a Soviet invasion have diminished. He said that the united position of the western allies was one of the factors in Moscow's determination that it has not been in its interest to intervene.

The East and West must help Poland to survive its serious economic and political problems peacefully, he said. "Our basic objective is to do all we can to permit the situation to evolve, and to have that situation evolve based on the wishes and desires of the people of Poland," he said.

Haig said that higher levels of defense spending are central to President Reagan's foreign policy and indicated that there will not be major reductions in the planned $1.6 trillion five-year defense budget. Defense Secretary Caspar W. Weinberger said earlier yesterday that "I think deep cuts are not even contemplated because deep cuts would prevent us from making the kinds of recovery in our arms strength that we have to have to deter attacks."

Haig referred to any forthcoming reductions as "belt-tightening and a higher state of efficiency," making it appear that at most the president will order a slight reduction in the rate of growth in defense spending. The sums are so large, however, that each percentage increase or decrease involves a considerable amount of money.

"I think it is very, very important, however, that the underpinnings of President Reagan's foreign policy require a rectification of the slackening of the defense effort, which his current policies embody and which I am absolutely confident he will continue to pursue," Haig said, making the same point as Weinberger in his special language, sometimes called Haigese.

For the most part, however, Haigese was kept under wraps as the secretary appeared relaxed and confident of his ability to handle any and all questions.

On southern Africa, Haig bent over backward not to offend South Africa. When a questioner noted that the United States had deplored South Africa's current invasion into southern Angola, Haig stopped to rephrase the question, stressing that all escalations of violence in the region were deplored and listing the actions by Angola that also trouble U.S. policymakers.

Haig referred twice to his upcoming meeting with Gromyko, saying that in addition to attempting to lay the groundwork for talks on reduction of tactical nuclear weapons based in Europe, he will raise a number of troubling issues with his Soviet counterpart.

In addition to El Salvador, he said, he will bring up the Soviet occupation of Afghanistan; the Vietnamese occupation of Kampuchea (Cambodia), which Moscow supports, trade issues and intervention in Third World nations by the Soviet Union and its allies.