A weary Congress last night passed a huge spending bill needed to carry the government through the first two months of the new fiscal year, which began yesterday morning.

The omnibus funding bill passed the House 290 to 123 and the Senate by voice vote.

Congress worked well past midnight and recessed about 2:30 a.m. today for the campaign and Nov. 2 election, to return for a lame-duck session on Nov. 29.

Before going home, Congress also adopted and sent to President Reagan two other major bills: a new job training program for youth and unskilled workers to replace the expired Comprehensive Employment and Training Act and a short-term highway aid extension.

The $3.8 billion job training bill differs from the original House version in that it provides no wages to trainees. Reagan has said he will sign the measure.

The bill, which comes after a month of bitter partisan wrangling, is expect to train more than 1 million persons a year.

The highway programs were extended for six months after a more expensive version that would have set aside $8.6 billion for a year was rejected.

The House, on a voice vote, sent its slimmed-down $5.1 billion measure back to the Senate which concurred after passing the more costly bill earlier in the day.

In addition, a $7 billion military construction appropriations bill, more than $1.1 billion short of the administration's request, was approved. However, the president was expected to sign the measure, only the second fiscal 1983 appropriations bill approved.

In another action, over the objections of Majority Leader James C. Wright Jr. (D-Tex.) and other Democratic leaders speaking for small banks, the House gave final approval to a bill extending indirect federal aid to troubled savings and loan associations and broadening their power to compete more directly with money market funds. [Story, Page D1.]

The action cleared the bill for presidential signature.

In other action early today, Congress cleared bills to protect barrier islands on the Gulf and Atlantic coasts, establish export trading corporations, increase the federal payment to the District of Columbia, authorize $9 million in loans and grants to rebuild the Wolf Trap center, and to allow Amerasian children to enter the United States.

The stopgap funding bill was delayed in Congress because of a House debate over the balanced-budget amendment, thus leaving the government technically operating without money or legal authority for 24 hours.

The spending measure will carry through until mid-December. The theory is that this will leave Congress time to pass regular appropriations bills for government agencies when it reconvenes.

More and more in recent years Congress has been forced to resort to continuing resolutions of yesterday's kind to keep the government in business.

Last year, in a dispute between President Reagan and Congress, the government was shut down for a day when no resolution passed.

This year, with no such dispute in sight, agencies were allowed to stay open.

But Rep. Bill Frenzel (R-Minn.) still took Congress to task for its seeming inability to pass the basic appropriations bills on time.

Attacking Congress' "unwillingness to manage our own affairs" and the resolution's "undisciplined anarchy," Frenzel said "almost nobody knows what is being passed. We have rolled our appropriations into one single foul-smelling lump. Then we sent it over into a worse sinkhole in the Senate , which added nongermane, nonsensical and nondebated amendments."

Only one of the 13 annual appropriations bills -- the one covering the Housing and Urban Development Department and several independent agencies -- has been signed into law.

The military construction bill, by clearing both houses last night, would be the second.

The resolution continues funding for agencies covered under other apprpriations bills for the most part at 1982 levels or at the House- or Senate-passed level for 1983, whichever is lower.

However, one notable exception is the compromise over spending for military programs, which were funded at $205 billion in 1982 but jump to an annual rate of $228.7 billion under the resolution, which expires Dec. 17.

The bill extends the current freeze on pay and bonuses of senior executive, legislative and judicial officials and employes, including members of Congress, at the Sept. 30, 1982, level.

However, after initial objections from House conferees, it increases the pay of air traffic controllers by 6.6 percent, retroactive to Aug. 3, 1981, a provision for which the Reagan administration lobbied hard.

Controllers had rejected the identical raise before going on strike last year.

Besides setting funding levels for federal agencies, the bill includes some 50 legislative changes, most added in the Senate to the distress of House members who worked hard to pass a "clean" bill free of controversial amendments or election-year goodies.

The add-ons included such serious matters as language prohibiting legal services for illegal aliens and prohibiting legal services lawyers from filing class actions unless they conform to regulations issued by the Legal Service Corp.'s board of directors.

One provision would forbid federal studies of market-rate pricing of hydroelectric power, an amendment amounting to a subsidy for certain farms, businesses and other buyers of federal electricity.

Some minor matters, such as a New Mexico grant for chimpanzee research, were dropped, but others survived the conference.

While Senate action on at least a dozen other pending bills was thwarted by objections and threat of filibuster by Sen. Howard M. Metzenbaum (D-Ohio), the legislative mill was not slowed on other issues.

Metzenbaum, claiming his obstructionism would save taxpayers more than $2.6 billion in unjustified "special interest giveaways," was objecting to measures that would have benefited the timber, oil, shipping, brewing and drug industries, among others.

Metzenbaum notwithstanding, by 10 p.m. the Senate had given its approval to 129 resolutions, bills and conference reports, ranging from federal aid highway legislation to congressional memorialization of the tricentennial of German settlement in the United States.

During one 36-minute span, with Majority Leader Howard H. Baker Jr. (R-Tenn.) and Minority Leader Robert C. Byrd (D-W.Va.) turning the crank, the Senate approved 33 items by voice votes--perhaps not a record, but not a bad day's work either.

But most involved issues that one did not even have to understand to support: they were "gimme" measures that become particularly appealing to legislators on their way out to reelection efforts.

They included naming November as Christmas seal month; designating a national housing week, school bus safety week and home health care week; approving a Robert Goddard Day, honoring the father of American rocketry, and other kindred issues.

One of the more-spirited debate elements involved the ever-controversial question of truck widths and highway safety.

Current law limits truck widths on federal roads to 96 inches, but Sen. Mark Andrews (R-N.D.) proposed that it be increased to 102 inches.

The Senate compromised, accepting an amendment by Thomas F. Eagleton (D-Mo.) making the 102-inch width "permissive," that is, leaving it to individual states to decide.