The House, fighting off efforts to cut legal services for the poor, approved a $14 billion spending bill yesterday to give scores of government agencies money for fiscal 1988.

The measure, approved 292 to 102, goes to the Senate for further debate.

It provides money to finance programs in the Commerce, Justice and State departments in the year beginning Oct. 1 and to pay operating expenses of federal courts and various agencies.

The $14 billion total is about 6 percent more than the same agencies will spend in the current fiscal year and about 4 percent less than President Reagan had requested for next year.

The bill had been larger, but lawmakers voted, 228 to 166, to trim about $400 million in across-the-board cuts in all but a few accounts for the Immigration and Naturalization Service and the FBI's drug-enforcement campaign.

Included on the spending list is $305.5 million for the Legal Services Corp., which provides legal aid for the needy.

Reagan had sought to eliminate the agency, and the House voted, 282 to 187, against an amendment proposed by Rep. Norman D. Shumway (R-Calif.) that would have gone along with the president's request.

"The Legal Services Corp. has proven to be a costly and ineffective system" in its effort to achieve the "worthy goal" of protecting the legal interests of the poor, Shumway said.

"We're way too low with $305 million," Neal Smith (D-Iowa) said. "We ought to have more money in this instead of less."

An amendment to cut $25.5 million from the $305.5 million total was also rejected, 212 to 198.

Also in the bill is $206.5 million for the Economic Development Administration, whose programs Reagan had sought to eliminate. Lawmakers voted, 269 to 146, against an amendment that would have cut all but $26 billion of the agency's budget.

Other sections of the bill would add $202 million more than Reagan had requested for various programs to aid local law enforcement agencies in fighting juvenile delinquency, drug abuse and other problems, increasing the total to $280 million.