The Senate yesterday passed a bill authorizing $5.5 billion a year for the Carter administration's major housing proposals, including a new formula tilting more money to the decaying cities of the Northeast and the Midwest at the expense of the Sun Belt.

The vote was 79 to 7.

Over $4 billion a year is for block grants to cities for community development. More than $1 billion is for a start of contracts in 1978, and continued obligations therafter, for 400,000 new units of subsidized rental housing for the poor.

In the only big administration defeat, the Senate voted 49 to 36 kill an existing law that seeks to block private construction in flood-prone communities that refuse to join the federal flood insurnace program. Sens. Thomas F. Eagleton (D-Mo.) and John C. Danforth (R-Mo.) said the law is a classic case of bureaucratic coercion of local communities. But Sen. William Proxmire (D-Wis.), the bill's floor manager, said the amendment undermines attempts to bar overdevelopment in flood areas by persons who will want the government to pick up the tab in case of a disaster even though they have opted out of the flood insurance program.

For the Northeast and the Midwest, which have frequently lost formula battles to the Sun Belt not only on housing but on a variety of other programs, inclusion of the new formula was an important victory - the result in part of the Carter administration's desire to channel the money differently from the past, and in part sponsors said, of general recognition that urgan decay in the nation's older big cities has become a national crisis.

In its major provisions, the bill authorizes $4 billion in fiscal 1978, $4.15 billion in fiscal 1980 for the community block grants and certain related programs. This is the biggest federal housing aid program, set up in 1974 and uniting 10 different, smaller programs into a single big grant for hard-pressed urban areas. The money can be used for sewer and water facilites, parkland and recreation, restructing of neighborhoods, slum clearance - a broad variety or urban improvement purposes.

The new formula, sought by Housing and Urban Development Secretray Patricia Roberts Harris, applies to the bulk of the money in the community development grant program.

It would allow a city to calculate its entitlements on the basis of age of housing and lag of population growth and poverty, if this would give it a larger amount of money than under the existing formula based on population, poverty and crowding.

Supporters of the formula said housing aid and growth lag are strong indicators of urban decay and weakening tax base. The Senate bill, going Harris one better, also would allow a city to factor in the per cent of housing built before 1940 in comparison with other cities - thus tilting the distribution ever more to decaying Northeast and Midwest cities. Under the bill, the city could use whichever of the three formulas would give it the most. Harris opposed the addition of the added pre-1940 per cent formula, which was sponsored in committee by Harrison A. Williams Jr. (D-N.J.) and Edward W. Brooke (R-Mass.).

In practice, the new formula would mean a lot more money for the District of Columbia - $32 million - than it would get if only the old formula were kept ($17 million), according to HUD estimates. The same is true of Baltimore - about $29 million instead of $19 million.

Of the $4 billion and more for community development in the bill for each of the next three years, Harris had asked that $400 million be set aside each year for her use to help cities in severe distress and deterioration. The committee made this set-side in theory, but provided that extra money obtained by cities who use the pre-1940 housing factor be taken out of the $400 million, thus reducing the special distress fund by about half over the three years.

The $1.1 billion annual costs for the subsidized rental units for the poor would continue in some cases up to 30 or 40 years, and the ultimate total cost when all the 400,000 units are paid for would be about $30 billion, but that would be distributed over many years.

Proxmire and Budget Committee Chairman Edmund S. Muskie (D-Maine) disputed whether the added costs for the follow-on years for these units should be shown, technically, as part of the 1978 budget. Muskie insisted they should be, and won, 70 to 18.

The bill also authorized $708 million in fiscal 1978 for operating subsides for public housing and extends for a year a broad variety of other federal loan-guarantee and rural housing programs. It ups the basic FHA-guaranteed loan for a one-family house from $45,000 to $60,000; for two and three family houses from $48,750 to $65,000, and for a four-family house from $56,000 to $75,000.

The bill also attempts to curb "red-lining" - discrimination by banks against giving mortgage loans to some group or area, often on racial grounds - by requiring banking regulatory agencies to consider whether a bank has made sufficient loans to its immediate community before granting applications for new branches.