Federal housing officials are moving to relax one of their most controversial policies -- the requirement that most of the nation's public housing projects be built in white or integrated neighborhoods.

The eight-year-old policy -- designed to provide opportunities for the poor to move out of the ghetto -- has generated so much protest that some areas have refused to build any housing for the poor.

White neighborhood groups from Forest Hills to Chicago have fought federal housing from the beginning eight years ago, but over the past year objections have come from new and unexpected quarters from some black congressmen and mayors and from inner-city community groups.

Rep. William Clay, who represents a depressed section of North St. Louis, is typical. He calls the policy "stupid and asinine" because "[it gives all the housing] to St. Louis County where you have a recalcitrant, racist administration opposed to building housing for black people," while his district continues to deteriorate.

Clay and others say that by emphasizing a policy of integration, federal housing officials have often left black neighborhoods to rot. At the same time that whites and substantial numbers of the black middle class are disdaining public housing as an intrusion that raises the crime rate and lowers property values, these black elected officials and community groups are actively seeking the spurned federal dollars. They want to build new housing and repair and refurbish the growing numbers of substandard dwellings in the inner city.

For some black congressmen, there is another related concern; decaying housing is forcing people out of their congressional districts and, as the population dwindles, their once-safe seats are being threatened.

The pressure to alter current integration policies for federally subsidized housing has produced some unlikely alliances: congressmen from inner-city communities that want more public housing have begun to join congressmen from the suburbs and white ethnic neighborhoods that do not.

A move in the House last month to force federal housing officials to build three of every four public housing units in the ghetto was stopped by housing subcommittee Chairman Thomas L. Ashley, who said the bill went too far. But, Ashley said discussions he has had with officials at the Department of Housing and Urban Development led him to believe that they will come up with new policies that will satisfy Congress.

Since the spring, Housing and Urban Development Secretary Moon Landrieu has had aides working on the problem and he has solicited the views of mayors and congressmen as well as civil rights groups that are extremely wary of any change. In an interview, Landrieu, edgy, defensive and insisting that he did not intend to turn the clock back on housing desegregation, declined to discuss in detail what shape he hoped new policies would take.

His aides, however, have been talking about easing up on communities that have already achieved a fair amount of housing integration while continuing pressure on cities and suburbs that have ignored desegregation requirements and put most federal housing in poor and black neighborhoods.

Landrieu said reconsideration of the policy was already under way when he was nominated as HUD secretary in July 1979. As he prepared to take control of the housing bureaucracy, his predecessor, Patricia Roberts Harris, told him, "I'm leaving you with a great issue."

It is not significant that the process of revising the policy has lingered on into the presidential campaign, Landrieu said.

"We've been in the canpaign since the day I got in here and it has nothing to do with it," he said.

Four years ago, President Carter caused an uproar during the campaign when he declared that he favored policies that preserved the "ethnic purity" of established urban neighborhoods. He later retracted that statement after a storm of protest from blacks.

Landrieu, who said he has not discussed the pending rule change with Carter, said there was no similarity whatsoever between "ethnic purity" and the changes under consideration.

He said tougher fair housing legislation that is backed by the Carter administration and now is arduously moving through Congress would protect the right of blacks and other minorities to rent or buy housing anywhere they could afford to do so.

There was one philosophical point he did wish to emphasize about subsidized housing and integration, however.

"When we passed the public accommodations law, [did we] say that a person, irrespective of race, color or creed, had the right to go into any hotel or restaurant in this country?" he asked an interviewer.

"We did that," Landrieu responded firmly. "What we didn't do in that process, that we're doing in housing, is say, "Here's 50 bucks, go to the best restaurant in town and eat."

His tinkering with the desegregation guidelines for federally subsidized housing has raised dissension and fears among civil rights groups and among traditional liberals within his own department.

The other day a close aide went to Landrieu to report that the question, "What is Moon doing?" was quietly being asked up and down the halls at HUD.

"I know," Landrieu said.

Until the 1960s, federal housing for the poor was most often segregated and isolated, often behind some barrier -- a canal, railroad tracks or, as in the case of the teeming Anacostia public housing projects in Washington, a river. These dense concentrations of the poor are often nests of violence and squalor.

Breaking up these government-built slums and providing opportunities for the poor to live outside the ghetto became federal housing goals pushed by the courts, Congress and HUD in the late 1960s and early 1970s.

HUD developed a standard of not building housing in neighborhoods that were more than 40 percent black unless some "overriding need" could be shown. In the jargon of the housing bureaucracy, the policy became known as "dispersal" and "spatial deconcentration" of the poor.

A funny thing happened when aides to Landrieu went back to research the history of the policy. They were able to trace its use in department decisions back to about 1972 but were unable to find it written down anywhere. In the absence of any documentary evidence that it is a formal department rule, they have taken to referring to it now as a "custom."

In heavily black cities like Washington and Detroit, the custom has been widely ignored. New federally subsidized housing for poor and moderate-income families here has been built up and down 14th Street in the heart of one of Washington's riot-scarred ghettoes, D.C. Housing Director Robert Moore observed that other HUD rules limiting the price HUD can pay for land effectively ruled out the possibility of building public housing in white neighborhoods west of Rock Creek Park. Vacant land there is too scarce and costly.

Other cities like Chicago and Atlanta, with smaller proportions of blacks, have also tended to ignore the rule and put most of the public housing in black neighborhoods. But in several cities -- Pittsburgh, Richmond and Cleveland, for example -- a substantial amount of federal housing has gone into white or integrated neighborhoods, according to HUD surveys.

Around the country, however, the policy has been controversial -- it has been picketed, protested and opposed by resident of ethnic neighborhoods in the city and white communities in the suburbs as well. Officials have also run into opposition when efforts were made to put the housing in middle-class black neighborhoods.

Several suburban towns around Detroit have refused to build any housing for poor families, even though they risk losing federal dollars for community development.

Opposition of another sort has come from Rep. Clay and other black elected officials. Housing in his district is overcrowded, with large numbers of people living in substandard dwellings. He sees a cruel irony in HUD's decision to avoid building new federal housing in North St. Louis because it is overwhelmingly black and poor.

Clay acknowledges that his dissatisfaction with the situation extends to concern about the erosion of his power base as the population of North St. Louis dwindles.

"The only power base that black people have is in politics," he said. "And if we disperse that power base before we totally integrate into other power bases, we're damn fools."

Civil rights advocates like M. Carl Holman of the National Urban Coalition said they believed it unwise to frame national policy for the purpose of protecting the political bases of black elected officials.

That brought a sharp retort from Clay.

"What civil rights groups?" he asked in a tone of unmistakeable sarcasm. "We don't have them in St. Louis."

Holman indicated he is more sympathetic to concerns, expressed by some community groups in central-city neighborhoods, that the HUD policies are a form of federal government redlining that led to decay of neighborhoods, making them ripe for speculators and "gentrification."

Landrieu said he is also sensitive to those concerns.

Questions he is wrestling with, Landrieu said, include: "Where from an economc standpoint can we locate low-and moderate-income housing?From a cost standpoint can we put it in every neighborhood irrespective of cost? Is it socially appropriate to do so and politically acceptable?

"The issue is sensitive and people come at it from so many different perspectives," he said. "It is not an easy question. And it is a very delicately balanced question."