House Republicans were foiled yesterday in their attempt to keep an expansion of Medicaid benefits from becoming automatic.

Republicans argued that open-ended automatic benefit programs make up 75 percent of the budget, and have grown twice as fast over the last 10 years as programs for which Congress annually authorizes and appropriates funds.

However, the attempt by Rep. Dave Stockman (R-Mich.) to subject the new Medicaid program to annual congressional authorizations and appropriations failed, 226 to 152.

The vehicle for the vote was the child health assurance program, which would replace Medicaid for children and make additional low-in-come children and pregnant women eligible for coverage. It also would expand services to include, among other things, dental care, eyeglasses, unlimited psychiatric care and medicine.

Before putting off a final vote on the bill until Tuesday, the House also wrote into the bill a prohibition on funding Medicaid abortions except where the life of the woman is endangered.

Stockman and the other Republicans hoped to make yesterday's attempt the first in a series of attacks on uncontrollable entitlement programs. But they lost 20 Republicans and gained the support of only 42 conservative Democrats.

Stockman said that if spending is to be manageable, control of entitlement programs is vital. "We've created a perpetual-motion machine -- a self-propelled, trillion-dollar money machine that is out of control."

"We have reduced Congress to a green-eye shaded disbursement officer who totals up bills, write checks, then trundles off to the chapel to mourn," Stockman said.

Budget Committee Chairman Robert N. Giaimo (D-Conn.) agreed that entitlements must be controlled, but added, "Let's not do it in this fashion. Let's not start with the highest priority issue of the federal government -- health."

Giaimo said Congress must look at the whole range of entitlements which includes such diverse items as crop inserance and food stamps. "This is not a wise place to start a reform movement," he said.

Henry J. Hyde (R-Ill.) said what Giaimo was saying was "we'll sober up tomorrow but meanwhile pass the bottle."

The CHAP bill, which is before the Senate Finance Committee, would cost an estimated $5.5 billion through 1984. The federal share for Medicaid is fiscal 1980 was nearly $13 billion.

The vote on the abortion restriction was 217 to 169.

Similar prohibitions often have been added to appropriations bills' but never into the permanent enabling legislation. The stringent prohibition, which consistently has been the House position over the past seven years, would go further than the current proposal, negotiated with the Senate and written into a recently passed resolution continuing funding for health programs. that prohibition would allow federal funding of abortions in cases of rape and incest in addition to cases where a women's life was endangered.

The House action yesterday means that another drawn-out abortion fight with the Senate, which traditionally takes a more lenient stand on the issue, is likely.