The House defied President Reagan last night as moderate Republicans joined Democrats in approving an $87.3 billion appropriations bill for education, health, welfare and jobs programs that GOP leaders described as a prime target for a veto.

A vote against sending the measure back to committee for major cuts was close enough to provide "clear evidence, with room to spare, that a veto can be sustained," House Minority Whip Trent Lott (R-Miss.) said after the bill passed.

News from the Senate was potentially worse for Reagan. Appropriations Committee Republicans, rejecting his proposal for a 12 percent cut in discretionary domestic spending this year, agreed privately to double his $2 billion defense cut while taking $1 billion from domestic programs rather than the more than $8 billion Reagan proposed.

Senate GOP sources said they would couple the overall $5 billion appropriations cut with cost-of-living adjustments for big entitlement programs and a three-month delay in the mid-1982 tax cut.

In the House, after more than seven hours of deliberation, the vote was 249 to 168 against recommitting the measure, with 39 Republican moderates joining the Democratic leadership in opposing the move while 28 Democrats voted for it.

Among Washington area members who voted on the bill, only Rep. Frank R. Wolf (R-Va.) voted to recommit the measure.

The bill, viewed as a test of strength for Reagan's latest round of budget cuts, was approved by a voice vote and sent to the Senate, where the administration is expected to concentrate its pressure for new spending cutbacks.

The House action stood in sharp contrast to previous Reagan budget victories, when enough Democrats joined a solid Republican minority to give the president what he wanted.

"This was a message to the budget cutters that the House does not want to see the 'safety net' cut to shreds," said Rep. Bill Green (R-N.Y.), a moderate Republican leader.

Earlier in the day, the House, with support from its Democratic leadership, voted to cut $74 million from the bill, just enough to bring it into technical compliance with Congress' budget targets and undercut arguments that the House is busting its own budget.

But the bill, the first to come before either chamber since President Reagan called for a new round of spending cuts two weeks ago, exceeds Reagan's new goal for spending in these areas by nearly $3.5 billion, according to administration officials.

This made it a likely veto target, even though it would appropriate $1.2 billion less than Congress approved for the same programs last year, largely because of cuts it would make in federal jobs programs.

So the administration, backed by House Republican leaders and their conservative Democratic "Boll Weevil" allies, was pushing hard to scuttle the bill, directly or indirectly, by sending it back to the Appropriations Committee.

"The White House is putting on a full-court press out there," said Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) shortly before debate opened on the bill, nodding toward the House floor. "It's very possible we've lost a majority," he added, reflecting Democratic concern about the outcome in light of previous budget losses.

Spending levels in the bill are critical to the administration if it is to get another $16 billion in spending cuts and revenue increases on top of $35 billion in savings already approved by Congress, as Reagan proposed last month.

One reason is the bill's size, second only to that of the defense appropriations bill. Another is that Reagan must demonstrate that he can block money bills he views as excessive, or at least demonstrate that he has the votes to sustain a veto, which adds up to one-third plus one of the House members.

Moreover, troubles for the bill would add to pressure for an omnibus package of spending cuts before Congress quits for the year. This could come in connection with the final budget resolution or extension of a stopgap spending bill for the government that Congress approved last week to last until Nov. 20.

The administration's earlier budget victories came when lawmakers voted on Reagan's program as a whole, rather than on specific spending cuts, and some legislative leaders say they believe he may have to resort to this all-in-one strategy again if he is going to get his new round of savings.

Yesterday's debate underscored how difficult these cuts may be on a bill-by-bill approach. Even Rep. Ralph Regula (R-Ohio), outlining a package of possible Republican cuts in the big social welfare bill, proposed no more than $800 million in savings, which would fall considerably short of the economies Reagan called for last month.

In addition, Republicans appeared seriously split for the first time.

Parting company with Minority Leader Robert H. Michel (R-Ill.) and other GOP leaders who argued for deeper cuts, Rep. Silvio O. Conte (R-Mass.), ranking Republican on the Appropriations Committee, defended the committee's bill as "America's investment in humanity . . . both fiscally responsible and humanly responsive."

In addition, Rep. Carl D. Pursell (R-Mich.), chairman of the Northeast-Midwest coalition of moderate Republicans who call themselves "Gypsy Moths," defended the bill as drafted, and said it shouldn't be used as the vehicle "to balance the whole federal budget." He also dismissed the notion of sending it back to committee as a "symbolic gesture."

As the House spent most of the day debating amendments to the bill, it approved, 271 to 148, a proposal to let the government resume paying states for drugs prescribed by Medicaid doctors, even if the drugs have not been proved effective. Congress had banned such practice in its earlier spending cuts bill.

The $74 million that was cut from the bill came primarily from a work-incentive program administered by the Department of Health and Human Services and from general administrative expenses.

Among cuts from 1981 spending that were contained in the committee-approved bill were $5.6 billion from jobs and other programs administered by the Department of Labor and $252 million from programs run by the Department of Education, according to Rep. William H. Natcher (D-Ky.), chairman of the labor, health and human services appropriations subcommittee. The bill added $4.6 billion for health, welfare and other programs under HHS.