Secretary of State Alexander M. Haig Jr. said yesterday that Cuba recently received a second squadron of Soviet Mig23 warplanes as part of a systematic expansion of the island nation's ability to project its military power.

Haig's testimony before the Senate Foreign Relations Committee followed nearly three weeks of official silence, during which the government refused to confirm that Soviet crates detected at an airfield outside Havana early this year contained a new shipment of Mig23s.

Haig charged that Cuba and Nicaragua have responded to recent U.S. overtures with "greater internal repression, acceleration of arms buildups and a strengthening of links to the U.S.S.R."

Haig also charged that clandestine infiltration of arms and munitions into El Salvador is "approaching the high levels" recorded just before a guerrilla offensive there early last year. A sharp decline in the infiltration had been reported last spring and summer.

In recent weeks, while refusing comment on reports about the arrival of the mysterious crates in Cuba, Haig took up the matter with Soviet Foreign Minister Andrei F. Gromyko in Geneva, and President Reagan sharply criticized a Cuban arms buildup.

The presence of the crates was reported in The Washington Post Jan. 13, and some officials praised the report as having placed the matter in proper perspective.

However, Reagan was reported to be upset by the account, which was cited by senior officials as part of the justification for new government secrecy regulations.

After publication of the story, a White House official said, the crates were obscured from view. Since the Migs have not been assembled, according to official sources, it is not possible to ascertain if they are the usual interceptor version supplied by the Soviets to their overseas allies or an enhanced variety.

The initial squadron of Mig23s was received by Cuba in May, 1978, causing a flurry of controversy within the Carter administration and discussions of the issue with the Soviet Union and Cuba.

The current crates appear to contain most but probably not all of a second full squadron of 12 planes, sources said.

In keeping with the administration's low-key treatment of the matter, Haig made no effort to highlight his disclosure, which came near the end of his prepared testimony for the first of a series of hearings on East-West issues. In the 2 1/2-hour hearing no senator questioned Haig about his statement that "a second squadron of Mig23 Floggers" had arrived in Cuba this year.

Haig said this complemented 63,000 tons of war supplies received by Cuba from the Soviet Union in 1981, all atop "by far the largest air, land and sea inventory of the region."

Most of the hearing was devoted to East-West repercussions from the martial law crackdown in Poland.

Under questioning, Haig defended the administration's decision to refinance $71 million in Polish debts to private U.S. banks, saying that to do otherwise would "bring down the temple of western unity."

Haig said Reagan personally approved a unanimous governmental decision last week to repay the banks for principal and interest currently owed by Poland on loans guaranteed by the Commodity Credit Corp.

The government, in taking over these obligations, will maintain pressure on Poland and its international sponsor, the Soviet Union, to pay them in time.

But to declare Poland in default of the loans, as some critics of the administration have suggested, would diminish this pressure, according to Haig.

"On the surface, it looks like you're being tough, that you're really going to do something" by forcing Poland into default. Actually, Haig said, "what the president did was tougher."

Midwest Republicans repeatedly confronted Haig with arguments against future embargoes of U.S. trade, including grain, on grounds that this would add to the farm export slump.

Some of the lawmakers added that the mere refusal to rule out a future across-the-board embargo against the Soviet Union was hurting the agricultural economy.

Sen. Rudy Boschwitz (R-Minn.) expressed support for renewing the U.S.-Soviet long-term grain agreement, the charter compact for continuing American grain sales to that country.

As one of his Poland-related sanctions announced Dec. 29, Reagan postponed negotiations with the Soviets on a new pact to replace the five-year agreement that expires Sept. 30.

"It would be a terribly costly thing to imply that we will not negotiate a new grain agreement," Boschwitz said.

Regarding food for Poland, Haig said the administration is considering the creation of a special organization to distribute U.S. humanitarian assistance there because facilities of the Roman Catholic Church and private relief organizations are overburdened.

He said about $65 million in assistance, "enough to feed 2 million people for six months," is backed up because of the limited capacity of Catholic Relief Services and other organizations.

A special distribution system to be created would require Polish government assurances that the food is going directly to the Polish people, Haig said.