Congressional supporters of President Carter's plan to control hospital costs fought hard to keep it alive yesterday in a sharply divided House Ways and Means Committee.

By a vote of 18 to 17, committee members voted to restrict the administration plan - if finally adopted - to a mere three-year lifespan. A new vote by Congress would then be needed to extend it.

But the committee accepted the bulk of a series of 23 amendments designed to make the administration proposal more palatable both to the country's hospitals and to several states that already have their own hospital cost control plans.

Twice, foes of the administration plan failed only by 18-to-18 votes to pass further amendments to weaken it.

A final committee vote could come today or Friday on the Carter plan. It would set a federal limit on hospital spending if, but only if, hospitals themselves fail to control their future expenditures.

Also, the Senate Finance committee is expected to vote today on the administration plan, in a version written by Sen. Gaylord Nelson (D-Wis.).

Inspired in large part by the threat of federal controls, the country's hospitals spent only 12.5 percent more in January, February and March 1979 than they did in the same quarter of 1978, according to figures supplied by the hospitals' own "Voluntary Effort," their national cost-cutting coalition. Just a few years ago hospital spending was increasing by about 15 percent yearly.

Under the Carter plan, federal controls would go into effect if hospitals fail to hold their annual increase in expenditures to 10.9 percent assuming general inflation continues at about today's level. If inflation worsens, under the bill's formula, they could spend more.

Under the slightly more permissive version being considered by the Ways and Means Committee, federal controls would take effect if hospitals fail to hold their annual increase in expenditures to 11.6 percent, again under current economic conditions.

The administration's main supporter in the committee, health subcommittee Chairman Charles Rangel (D-N.Y.), argued that the administration bill is needed to keep the hospitals' voluntary effort working, and to keep hospital costs from bankrupting the nation.

Opponents argued that the administration cost controls would "freeze" today's hospital technology, and prevent hospitals from adding new life saving services.

Committee Chairman Al Ullman (D-Ark.) promised Rep. Ken Holland (D-S.C.) that he will be recognized today on a motion to recommit the entire plan to the health subcommittee - in other words, kill it.

Holland is one of several Democrats cool to the measure. Administration and health industry lobbyists agree that the committee seems split 50-50 on the issue, and a final vote could go either way.