The Reagan administration has a peculiar debt, perhaps two, to Robert E. White, Jimmy Carter's last ambassador to El Salvador.

It owes him something for speaking out his week. While applauding the administration's stand (based on intelligence his embassy collected) to halt foreign communist aid to the guerrillas, White criticized the large new shipments of military aid, with advisers, that Reagan seems to have in mind. Such shipments, he said, citing corroborating statements by Salvadoran officials, are demonstrably unnecessary from a military standpoint. Politically, they could swamp the reformers in the junta, embolden the anti-reformers and preempt a reconciliation of the democratic forces present on both sides.

For the boost that White's testimony gives to that side of the argument, the Reagan people could yet be grateful -- after they cool down. For White has said something wise and cautionary. It is even consistent with the administration's conviction that beleaguered friendly authoritarian governments should not be pressed for reforms. The junta quite easily threw back the guerrillas' recent "final offensive" without, as White put it, so much as a single American cartridge.

Why, then, should we thrust upon El Salvador arms and adviser that its leaders, even some military leaders, say they don't want? Won't the arms build up the neanderthals, finally driving out the Christian Democratic president, Napoleon Duarte, the one figure who stands between the present imperfect but improvable junta and an unalloyed military dictatorship? Won't the advisers provide beautiful targets to the otherwise fading guerrillas?

There is a hard gleam in the Pentagon's eye. In El Salvador, the military attaches have constantly fought political discipline and cultivated the very security elements responsible for thousands of civilian deaths. A derogatory Pentagon analysis of the Salvadoran military is now circulating, plainly intended to show that Americans are needed to do the job.

It is bad enough that the secretary of defense and his top aides hav apparently allowed military people at a lower level to steal the policy initiative from them. But why shoudl the secretary of state, who insists he is top dog in policy, let himself be railroaded by intelligence estimates and bureaucratic maneuvers set in motion before he came aboard?

Haig has put himself in a certain bind. he ousted or shelved the ranking people -- including White, the former assistant secretary and the key deputy -- who could have instructed him in the nuances of El Salvador. He has picked a new assistant secretary who is a stranger to Latin America and who bears the burden of having to show he is not Sen. Jesse Helms' tool. That is all the more reason for Haig to slow the military express and take his own look around.

Meanwhile, there is a second debt owed Robert White. A career diplomat, he is the only Carter ambassador Haig fired. That is a secretary's prerogative. White was a conspicuous, scrappy and controversial ambassador in a critical post, and Haig might well have wanted to replace him even if he intended, as he says he does, to continue trying to fortify the centrist cause.

In that case, he could have waited a bit, arranged an orderly and dignified change and offered White a commensurate assignment elsewhere. Instead, he withdrew White summarily, consulted him only perfunctorily and offered him a job White could not possibly have found acceptable.

We can expect to read various things about White in the next few days. The fact remains that Haig has seemingly destroyed the career of an extremely able and courageous diplomat whose principal "offense" was that he served the previous administration too loyally, too conscientiously, too well.

It is necessary to ask what this says about the quality of advice Haig expects to get from the career service. I am not talking about something theoretical or historical. The freezing out of White and a few others left the new administration to make policy on El Salvador in half a void. Surely that is some part of the reason why the administration, not content to do the bold and necessary thing of moving against the influx of guerrilla arms, is plunging toward the morass of transforming the nature of the war and the political struggle.

The pity of it is that this administration amy be passing up a winning alternative. Reagan and Haig already possess credibility with the military that Jimmy Carter could not have bought for gold. A quiet stay on new arms and a word to the wise in San Salvador could do wonders to strengthen civilian control of the military, to temper the security forces' assault on civilians and to give politicial dialogue a chance.

In sum, a diplomatic triumph, as well as a showing of military toughness, may lie within the administration's reach, if Reagan and Haig can muster the sense -- and the nerve -- to grasp it.