Uruguayan President Julio Sanguinetti had a major beef with the United States during his visit here last month.

As he traveled around official Washington, Sanguinetti complained that U.S. efforts to help its farmers hurt two of Uruguay's major agricultural exports -- beef and rice -- and undercut efforts of his 16-month-old democratically elected government to stabilize its control of the country after 12 years of military rule.

He said he was shocked to find that the United States has agreed to sell beef to Brazil for 30 cents a pound, about half the price Uruguay charges its South American neighbor. The bargain from the United States, which is trying to cut its dairy herd to reduce the milk surplus, cost Uruguay sales in a traditional market, Sanguinetti said.

He added that the United States is not the only country playing a dangerous game with agricultural trade. While visiting Egypt, Sanguinetti found that his hotel bought beef from France at one-third of what it would have cost in Europe.

Heavy government subsidies to U.S. and Western European farmers, amounting to about $20 billion each for the United States and the European Community, cripple the chances of less-developed nations such as Uruguay to sell their products in world markets. These countries depend on farm income for their economic viability.

"Industrial countries' agricultural policies may be aimed at solving domestic problems, but their effects spill over onto the rest of the world," the World Bank said last week in its 1986 World Development Report.

Sanguinetti put the effects of U.S. and European Community farm policies more graphically last month during a breakfast meeting with reporters and editors of The Washington Post: "Their balls bounce back and hit our windows, and we end up paying for the broken glass."

More than beef sales are at stake. Thailand and Uruguay say they will be hurt by a heavily subsidized program to sell more U.S. rice abroad. A similar program for cotton probably will cut into Pakistan's and Australia's exports to Korea.

Europe, which was a major purchaser of sugar on the world market until 1975, has turned into one of the largest exporters in the world, second only to Cuba, to the detriment of traditional Third World suppliers, including the Dominican Republic and the Philippines. EC sugar exports jumped 514 percent in the decade between 1975 and last year.

According to World Bank figures, EC farmers received 18 cents a pound last year for their sugar, which was sold in the world market at 5 cents a pound.

A group of ambassadors from Caribbean nations told the House Ways and Means Committee that U.S. and EC sugar subsidies undercut Reagan administration efforts to improve the economies of countries in the region through its Caribbean Basin Initiative. Especially hard hit has been the Dominican Republic.

"Our hopes for growth have been thwarted, largely because of the increased U.S. restrictions on Dominican sugar imports and because of the disastrous low prices in the world sugar market brought about by the EC's agricultural-subsidy practices," Dominican Ambassador Eulogio Santaella told the House committee last February.

In a speech two weeks earlier to an international meeting of sugar users, he said, "The Dominican situation may serve as a case study of the impact that protectionist policies of industrialized nations have in the nations that depend heavily upon agricultural products."

Agriculture Undersecretary Daniel G. Amstutz said last year that EC sugar policies cost less-developed producing nations about $2 billion a year in lost export earnings.

"Your sugar policies have disrupted the economy of Central America more over the past two years than Castro has ever since he took power," Sen. Lloyd Bentsen (D-Tex.) said he told President Francois Mitterand of France, the major EC sugar producer.

U.S. Agriculture Secretary Richard E. Lyng acknowledged that U.S. and EC farm policies "are clearly causing problems to developing countries as well as to developed countries in the export field.

"We lament this very much," he said.

Lyng's European counterpart, EC Vice President Frans Andriessen, agreed that "the situation created on the world market has impacted not only the European Community and the United States, but other countries. That is one reason we have to come to a mastering of world production.

"I do agree there is a problem. We try to avoid damage to others as much as we can," Andriessen continued.

But Australian Prime Minister Bob Hawke called U.S. and EC farm subsidies "a monstrous absurdity," and added, "What those two major trading blocs have to understand is not only are they hurting Australia . . . but they are ruining their own economic prospects."

Some of the affected countries are seeking ways to fight back. The issues are likely to come up in September, when trade ministers from around the world meet in Uruguay to begin talks that could start a new round of global-trade negotiations.

In advance of that meeting, though, beef-producing nations such as Argentina, Uruguay, Australia and New Zealand have met to discuss the U.S. program of reducing its dairy herds by selling 22 million pounds of beef at cut rates in overseas markets. Similarly, rice-producing nations of Australia, Thailand and Uruguay are meeting to see what they can do about U.S. subsidies that allow its producers to sell at lower costs.

Ironically, the World Bank's 1986 Development Report asserts that industrialized and Third World nations both suffer economically from their efforts to shield farmers from the forces of the world market.

According to World Bank estimates published last week, the farm-subsidy programs cost taxpayers and consumers of the United States, Western Europe and Japan $104.1 billion -- almost twice the $55.6 billion that the farmers of those countries gain. Cutting out those farm programs would save $48.5 billion for the industrialized nations, almost twice what they spend on aid projects for the Third World. These programs shield 2.25 million U.S. farmers and 11 million EC farmers from world-market conditions.

Developing countries, moreover, could help their economies to the tune of $28.2 billion if they liberalized their agricultural policies, the World Bank concluded.

The real losers of a global liberalization of farm policies would be the nonmarket economies of the Eastern European Soviet bloc, which the World Bank estimated would lose $23 billion.

"So why do countries not tear down their agricultural policies? The reason, of course, is that the interest groups whose support the policies aim to capture would lose," the World Bank said in its 256-page report, which this year is devoted mainly to agricultural policies and trade.

With U.S. agricultural trade running in the red in May for the first time in more than 20 years and a decline in farm exports from $44 billion in 1981 to $27 billion last year, it is unlikely that the Reagan administration will ease its export promotion programs -- no matter how much they distort world trade.

While President Reagan has opposed some subsidies -- particularly the one for U.S. sugar producers -- Lyng acknowledged 10 days ago, "Now we are engaging in some of the practices which we have strongly criticized in the past.

"We are doing so because we are determined to regain a substantial part of the agriculture exports we have lost during the past five or six years. We have taken this course reluctantly, after years of unheeded appeals on our part for the EC to reduce its production and subsidies."

Lyng said U.S. and EC farm-pricing policies are different. "Ours tended to keep our own commodities out of world market competition, while EC policies in effect flooded the world with heavily subsidized European commodities."

But Andriessen, denying that EC policies hurt U.S. overseas farm sales, said Western Europe is not going to roll over in the face of new, aggressive U.S. policies to recapture export markets.

Although American wheat exports dropped from 49 percent of the world market in 1982 to 36 percent last year, he said EC exports grew only slightly in that period, from 14 percent to 16 percent, and appear likely to drop back to 15 percent this year. In dairy products, Andriessen said, the United States has taken market shares from Europe, going from near zero to 10 percent of the butter market "mainly at our expense" and increasing from 10 percent to 26 percent of milk-powder sales "to our detriment."

He said the EC has "reacted precisely, and rather effectively, to keep our markets" against the onslaught of new U.S. export programs. "Did you really think we would do otherwise?" he asked at a recent EC seminar for journalists in Annapolis.

So there is a stalemate between the United States and Western Europe, and the impact of the fight for markets keeps reverberating around the world. In Thailand, for instance, stories on U.S. farm policies played on newspaper front pages every day for four months. The issue overshadowed First Lady Nancy Reagan's efforts during a May trip to Bangkok to deal with drug problems and came up during President Reagan's meeting with officials from Southeast Asian nations in Bali on his way to the Tokyo summit.

"The emotional level is high. There is anti-American talk at every level of society. Rice is the No. 1 political issue in Thailand," said Ammar Siamwallah, a rice expert visiting here from the Thailand Development Research Institute in Bangkok.

Michel Fribourg, head of a major agribusiness firm, Continental Grain Co., said U.S. policies, which fail to practice what Reagan preaches about free trade, leave Washington "in no position to pressure anyone else to reduce price supports and subsidies. American farm programs have been largely part of the problem, not the solution.

"But neither is the European Community in a position to point a finger of scorn at anyone," he said. "It has always geared its own price support programs to provide more and more production, guaranteeing even its highest cost producers a price well above the world market for their grain, livestock and poultry."