Why does a veteran Third World leader abandon classic fence-straddling diplomacy and throw himself publicly into Washington's embrace much to the Reagan administration's apparent surprise?

Assuming Sudanese President Jaafar Nimeri accepted that reading of his recent conduct, his answer very likely would be the clear and present danger he feels Libyan leader Muammar Qaddafi represents for his nearly 12-year-old government.

But to Nimeri's 20 million compatriots that alone does not explain why he has embraced the Reagan administration's anti-Soviet world view or broken Arab ranks by exchanging ambassadors again with the ostracized government of Egyptian President Anwar Sadat.

Few Sudanese would dispute Nimeri's right to be suspicious of Qaddafi, especially since the Libyan's decisive military role in ending the civil war to its own liking in neighboring Chad last December.

Despite initially excellent relations, the two leaders have waged a kind of personal holy war against each other for years and Nimeri is still infuriated by Qaddafi's backing for a nearly successful and bloody coup attempt here in 1976.

What questions are raised locally about Nimeri's present stance concern his wisdom in seeking a public confontation with Qaddafi now buoyed by his success in Chad in addition to his petrodollar wealth. For Nimeri is beset by financial problems that some economists maintain have reduced the Sudan to a basket case and in any event promise no early or easy solution.

Only last January three days of demonstrations in the western province of Darfur near the Chadian border greeted Nimeri's efforts to impose as governor of old Army colleague detested by the local citizenry.

Depending on which officials are talking, Libyan money may or may not have been involved in the Darfur demonstrations, in which 80 Sudanese wre injured. But the lesson was that Nimeri was forced to back down and replace the governor in a humiliating blow to his prestige.

Further complicating Nimeri's task was his decision to embark on a publicly popular, but apparently unfinanced, effort to organize six regional government elections in Africa's largest country.

Nor has that scheme's predecessor -- the local autonomy the Arab north granted the largely Christian south in 1972 after more than a decade of fighting -- gone without hitches. At present the south is smoldering against a decision to ship oil discovered on its territory to a refinery in the north.

Nimeri's local critics and some diplomats wonder if he has not embarked on his pro-Western confrontation policy to divert attention from the grim domestic situation. The recent 25th anniversary of independence from Britain has done little to enhance his prestige as Sudanese looked back at colonial rule with nostalgic mixed emotions.

Critics argue that Nimeri's seemingly unsolicited -- and now all but abandoned -- offer of eventual use of military facilities in case the United States were to underwrite upgrading them was meant as a political signal and nothing else.

He is credited with understanding the only limited value of naval facilities on the Red Sea, which can be bottled up by the Suez Canal to the north and the Soviet-controlled Bab al Mandab Strait to the south.

Even before Nimeri's offer the Reagan administration had tripled its military assistance program to $100 million starting in 1982 and could hardly do more in view of the proffered facilities' limited value.

Nimeri's public backing of Sadat also remains a mystery and observers are far from convinced that he cleared his surprise decision with Saudi Arabia.

In Sudan's poor financial condition, continued Saudi largesse -- $300 million this year -- is considered crucial in priming the complicated pumps that the World Bank, the International Monetary Fund, various governments and more than 100 Western banks have devised for economic recovery.

Possible signs of Sudanese establishment worry about Nimeri's behavior were visible in the recent testimony before the Sudanese equivalent of parliament by Foreign Minister Mohammad Mirghani.

He recalled the traditional Sudanese diplomatic truisms -- eight neighbors, crossroads of the Arab and African world, ties with East and West and nonalignment.

His remarks served to underline that Sudan's perennial politics of accommodation, although modified, have not been abandoned to the extent of including Moscow-backed Ethiopia in Nimeri's anti-Soviet remarks.

More cynical observers question the wisdom of advertising pro-Egyptian sentiments since they are convinced that Sadat has little choice but to support Nimeri in any case.No matter what governments are in power in Cairo and Khartoum, friendly or rival, historically they have been fated to cooperate because of their common interest in protecting the waters of the Nile.

"We now find ourselves stranded alongside a marooned Sadat," bemoaned one member of the political elite. "Since 1977 Nimeri had worked out a very sensitive and well-balanced equation in foreign policy, which he has now knocked sky high in favor of confrontation."

Some Sudanese explain Nimeri's behavior in terms of his health. Last year he underwent an operation on his carotid artery to relieve blood pressure variations that caused fainting. His doctors at Washington's Walter Reed Hospital are reported to have given him a clean bill of health.

But even those who have questioned Nimeri most in the past are convinced that he is more than ever the man of the hour.

"He's not got 100 percent backing from the Army and this is a military regime, nor does he have anything like 100 percent support from the police or the politicians," remarked one Sudanese intellectual. "Over the years a lot of Sudanese have stopped calling Nimeri an idiot and come to think he's endowed by some special providential protection."