Mayor Marion S. Barry defended his summer youth jobs program yesterday, telling a Senate subcommittee that the project had exceeded its goal by finding jobs for 32,335 city youngsters.

The mayor said investigators for the committee "were in error" when they issued a report last month saying the program had been "chaotic" and that it had fallen thousands of jobs short of its goal of 30,000.

Sen. Patrick J. Leahy (D-Vt.), chairman of the Senate D.C. Appropriations Subcommittee, told the mayor he was "mixing apples and oranges" by taking credit for more than 4,500 summer jobs routinely provided by private employers in the city rather than as part of the program.

Leahy also said the District of Columbia government's failure to find enough jobs created a $2 million "windfall" for the city because it spent only $5.2 million of $7.2 million appropriated by Congress in June for the program.

The mayor told Leahy that the major reason some of the money was left over was that "we were not able to immediately place a large number of youngsters in jobs."

Because of the slow start, he said, the city extended the program an extra week at the end of the summer in order to increase the pay received by the youths. The committee's investigators found that more than 20 percent of the youthful employes were paid less than $300 apiece for the summer.

Barry, who had requested the $7.2 million from Congress as critical to the program's success, also said the expenses were reduced because a large number of 14- or 15-year-olds signed up. They were paid $2.65 an hour, compared with the $2.90 an hour paid to workers 16-years-old and older.

"Had it not been for these factors," the mayor said, "we not only would have exceeded my goal of putting 30,000 youth to work last summer, we would also have spent the full amount of the additional appropriated funding."

The mayor said the unused money was transferred to the city's general fund, the basic budgetary source for most of its needs.

In answer to a reporter's question after the hearing. Barry said, "we don't ever make a profit." He said the unused money will be considered when we prepare our budget next year."

While the mayor would not concede that the goal of 30,000 jobs was overly ambitious -- it had been an important promise during his campaign last year -- he said a greater responsibility for finding jobs next summer will be shifted to private businesses. The city is asking for only about two-thirds of the 22,000 publicly-financed jobs that it got this summer, he said.

Barry said 42,347 persons between the ages of 14 and 21 registered for jobs last summer. Of those who got jobs, he said, 13,672 qualified under the Comprehensive Employment and Training Act (CETA) summer program for poor youth, and 8,475 got jobs, without regard to family income, from the speical appropriation. Leahy contended only those two categories, totaling 22,147 should be credited to the program.

In calculating 32,335 jobs, the mayor also included 1,472 youths referred by the program to federal agencies as regular summer hires; 822 similarly exmployed the the D.C. government; 820 referred to private businesses; and 796 provided by other CETA programs.

Along with the 4,593 jobs arranged by the Greater Washington Board of Trade, this made a total of 30,650. Later, a spokesman for the D.C. Labor Department said an additional 104 CETA jobs and 1,581 slots provided by D.C. government agencies on their own should have been included in the mayor's statement.

Another witness, Robert Taggart, administrator of the U.S. Department of Labor's office of youth programs, said his staff compared CETA programs in 11 big cities last summer and ranked the District of Columbia's as the worst.

Leahy quoted one of Taggart's aides as telling congressional investigators the D.C. program was "the worst he's ever seen. He (the aide) said he could not believe that Congress gave the District appropriated money to do as they pleased, with no restrictions on the kids, or worksites or anything."

Taggart said his observers found serious problems at about 56 of 88 worksites (64 percent) inspected in the city, compared to 25 percent in Cleveland, 31 percent in New York and 34 percent in San Francisco. The next worst to Washington was Pittsburgh, with problems at 57 percent of the sites visited, Taggart said.

The mayor argued that it is "not reasonable or fair" to compare the District's performance with cities that used only CETA funds and had much smaller programs. (Cleveland provided 11,000 CETA jobs.)

"The focus must be on the fact that what we achieved was substantial," Barry said.

Leahy agreed that "your goal is commendable," but said that "unless you can assure improvement" in the performance "it will be absolutely impossible to get one more penny" from Congress for the project.