The Senate last night approved the first overhaul of federal housing programs in a decade, after a testy skirmish between Texans and New Yorkers over the multibillion-dollar cost of cleaning up the savings-and-loan industry collapse.

The $17.8 billion housing authorization bill was approved, 96 to 1, in accord with a compromise reached Tuesday by Bush administration officials and key senators of both parties to reflect their varying goals for reshaping housing programs. Only Sen. William V. Roth (R-Del.) voted against the bill.

Bush's $14.5 billion request was increased by $3.3 billion in exchange for policy refinements, including targeting only the poorest for assistance, encouraging tenant ownership and discouraging new construction.

The measure anticipates an increase of about $12 billion for housing programs over the next three years, although actual spending would depend on annual appropriations bills that could be affected by a budget cuts now being negotiated.

The "Sun Belt vs. Frost Belt" dispute over the S&L scandal erupted when Sen. Phil Gramm (R-Tex.) proposed to change the formula for allocating $3 billion in community development block grants to help states with growing populations. With 36 states standing to gain under Gramm's proposal, sponsors of the housing bill feared it would pass and shatter the fragile consensus supporting the housing measure.

But Sen. Alfonse M. D'Amato (R-N.Y.) countered with a proposal to penalize states like Texas whose failed thrifts have absorbed a big share of bailout funds. "If we're going to get down to parochialism," D'Amato said, he was ready. He started reeling off costs to other states for a bailout he said could ultimately pump $118 billion into Texas.

Despite Gramm's protests that Texas was suffering as much as anyone from the thrift fiasco, he lost, 63 to 35. Many senators voted against him even though their states would have gained under his proposal. The Senate later agreed to a study of whether the allocation formula should be changed.

In one concession to the administration, funding would be increased for Housing and Urban Development Secretary Jack Kemp's program of Home Ownership for People Everywhere (HOPE), under which nearly $2 billion would be provided over three years to help residents in federal housing programs buy units they now rent.

A key Democratic program called Housing Opportunity Partnerships (HOP) would consolidate several small existing programs and provide subsidies to encourage state, local and private investment in an expansion of "affordable housing," starting with $2 billion next year.

Although the Senate's emphasis was on housing rehabilitation, the administration complained that the bill could lead to costly new construction and invite abuses such as those that occurred in HUD during the Reagan administration. It objected specifically to a provision under which local and state governments would have to put up only $1 of every $4 for new projects. The administration had wanted an even split but agreed to a 2-to-1 match.

While the compromise retains key Democratic objectives, said Sen. Alan Cranston (D-Calif.), it tightens the bill by "target{ing} federal housing assistance on very low-income families and provid{ing} additional assurance that new construction will be chosen only when it is the most cost-effective way to improve housing."

The agreement also seeks to prop up the Federal Housing Administration's troubled mortgage insurance program with more-stringent financing requirements, including one that would require up-front payment of two-thirds of closing costs by borrowers.

In all, it is the "most significant step. . . to combat conditions of homelessness, hopelessness, poverty and despair" since the war on poverty 25 years ago, said Kemp.