The Senate, bleary-eyed after losing a fight with the clock to avoid a government shutdown, yesterday approved a spending bill of nearly $500 billion to finance most of the government for the next 12 months and began negotiating with the House for a quick compromise satisfactory to President Reagan.

The "continuing resolution," wrapping funding for nearly two-thirds of all government activities into one package, was approved by voice vote after inclusion of a compromise anticrime bill hailed by Sens. Strom Thurmond (R-S.C.) and Edward M. Kennedy (D-Mass.) as landmark legislation.

Approval by the Republican-controlled Senate came 14 hours after the 12:01 a.m. deadline for passage of the measure, which the Democratic-run House approved in different form Sept. 25.

Although a 36-hour renewal of funding authority to allow the government to reopen today was approved by the House before the shutdown and by the Senate afterwards, two major obstacles remained in the funding controversy: serious differences between the House and Senate and the possibility of a veto if they are not resolved in a manner satisfactory to the president.

House-Senate differences include several major ones, ranging from aid for antigovernment guerrillas in Nicaragua to water projects at home, along with scores of minor disparities.

The House wants to ban further aid to the "contra" guerrillas, while the Senate, responding to administration pressure, wants to let it continue, presumably up to a committee-authorized level of $28 million for the year.

For water projects, the House wants more immediate funding than the Senate does: $139 million as opposed to $82 million. In addition, the House included new long-term authorization for at least $18 billion in projects, which the Senate refused to include in its version.

Several other disputes involve defense spending, including funding levels for antisatellite weapons and new "Star Wars" technology, and a complex computation game that will determine whether the Pentagon can squeeze another couple of billion dollars in new spending authority out of the budget for next year.

As the conferees got under way, they reached tentative agreement on several less controversial items. On water projects, Rep. Tom Bevill (D-Ala.) said a subgroup of conferees had agreed on about $110 million worth of projects, slightly less than the House-approved level, but remained split on the authorization measure, meaning that the issue would be put to the full chambers today.

Senate Appropriations Committee Chairman Mark O. Hatfield (R-Ore.) put the House on notice that inclusion of the water-projects authorization bill "will surely invoke a veto" of the entire continuing resolution.

Shortly before recessing, as smaller groups continued to work, the conferees tentatively agreed to compensate government workers for time lost yesterday.

It appeared from comments by several key negotiators that they remained at odds with the White House on such critical items as the water projects.

As the conferees met, the Senate approved a long-delayed highway funding bill that would release more than $7.2 billion for interstate construction and repairs. The money would provide funding for the last six months and for fiscal 1985. The House has approved a substantially different bill, and the White House has threatened a veto because of numerous pet projects added in each chamber.

These and other disputes will probably prevent Congress from meeting its adjournment target of the close of business today, according to Senate Majority Leader Howard H. Baker Jr. (R-Tenn.).

Baker and House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) said Congress probably will have to meet again Tuesday, after the Yom Kippur and Columbus Day breaks, if it cannot complete work by sundown, start of the Jewish day of atonement.

Administration officials have been threatening a veto in hope of forcing Congress to pare domestic spending, especially new funds for dams and other water projects, which the White House has indicated are excessive in both houses' versions.

Democrats and some Republicans suggested yesterday that Reagan might veto the spending bill as an anti-budget-busting gesture on the eve of his first debate with Democratic presidential nominee Walter F. Mondale. There also was queasiness about taking any controversial steps before the televised Reagan-Mondale encounter Sunday night, despite an overwhelming desire on all sides to go home and start campaigning.

"The way he is acting now, he seems to be building a case for a veto . . . so he can blame Congress," House Majority Leader James C. Wright Jr. (D-Tex.) said, charging further that it would be "the kind of Hollywood extravaganza" that Reagan might stage for the campaign.

In a letter to Hatfield late yesterday, Office of Management and Budget Director David A. Stockman reiterated the administration's support for a "clean" spending bill, without "extraneous provisions or last-minute funding add-ons." A Senate Republican aide said inclusion of the anticrime package does not guarantee either signature or veto of the measure.

Senate approval of the spending measure, which covers agencies for which Congress did not pass regular appropriations bills by the start of the new fiscal year Monday, came after a week of snail's-pace work further stalled by a dispute over civil rights legislation.

Congress has passed only four of its 13 regular appropriations bills, necessitating a continuing resolution to fund agencies covered by the other nine bills -- whose budgets for fiscal 1985 total nearly $500 billion, a record for one spending bill in Congress.

Departments covered by the catchall resolution include Defense, Agriculture, Interior, Labor, Health and Human Services, Education, Transportation and Treasury. Also covered are such large agencies as the General Services Administration and the Office of Personnel Management.

After scuttling the civil rights bill, the Senate plodded through 22 hours of work extending from Wednesday morning through shortly before 9 a.m. yesterday but still did not finish because of difficulty working out details of the anticrime bill.

That measure, including provisions adopted earlier by both the House and the Senate, embraces some but not all of Reagan's anticrime proposals and is viewed as an inducement for the president to sign the spending measure. It is also good campaign material for reelection-minded lawmakers.

The package, which would apply only to federal crimes, would eliminate parole and allow detention of dangerous defendants awaiting trial. In an attempt at major sentencing reforms, it would create a commission to establish guidelines for greater equity in punishment of criminals.

It would also shift the burden of proof in insanity cases from the prosecution to the defense, establish mandatory penalties when firearms are used in a crime and provide federal assistance to local police forces.

The crime section of the bill did not include several controversial Reagan proposals, including reestablishing the death penalty in federal cases and allowing some illegally seized evidence to be admitted in court.

"This is the finest crime package ever passed in the Senate," the conservative Thurmond said. It is "the most far-reaching anticrime and law-enforcement reform legislation in our history," the liberal Kennedy said.

The crime-fighting provisions were tacked onto the spending measure by unanimous vote in one of the few lapses in the leadership's drive to keep the bill free of extraneous legislation. That effort succeeded, for instance, in keeping the civil rights bill off the measure.

The rights bill, now dead for the session, would have countered a Supreme Court decision earlier this year that narrowed the scope of federal antidiscrimination laws.

The House began clearing its docket of final business, and there was a flurry of last-minute activity to revive the moribund immigration-law package.

Several members involved with that measure said a compromise may have been reached on an antidiscrimination provision that has stalled conferees.

The conferees disbanded last Friday without rescheduling another meeting, and the measure had been considered all but dead. But behind-the-scenes negotiations resumed yesterday, and Judiciary Committee Chairman Peter W. Rodino Jr. (D-N.J.), head of the House conferees, said he may reconvene the conference today to consider the new proposal.

The House approved compromises with the Senate on adult education act amendments, alcohol-and drug-abuse block-grant legislation and vocational education act amendments, among other things.

The Senate also refused, 54 to 44, to liberalize restrictions on Medicaid funding of abortions, reversing a position it took only a week ago on a voice vote. The defeated proposal would have allowed Medicaid funding in cases of rape and incest.

Current law limits federal assistance when the mother's life is at stake, and the House would continue the limitation. Because the two chambers are now in agreement, the existing restrictive language will continue in force.