Most of the $8 million appropriated by Congress for a program to transform surplus military buildings into shelters for the nation's homeless has been used instead for routine defense maintenance, General Accounting Office officials told a House subcommittee yesterday.

All but $900,000 of the $8 million appropriated in the last fiscal year for the Defense Department program was diverted to the Army Reserve, the officials said. In addition, they said, just two of the 600 military bases earmarked as possible sites for the shelters are being used for that purpose and only about 25 of the 190 Army commissaries that agreed to supply food surpluses to food banks for the homeless are contributing.

But Paul C. Wright, a GAO evaluator, said local groups had shown little interest in the military's offer to renovate its vacant buildings to house the homeless. As a result, only $200,000 of the money was spent for a project in Alameda County, Calif., and $700,000 more was obligated for a shelter in Philadelphia by last week's close of the fiscal year.

Wright said that the other $7.1 million was used for "defense fix-up operations."

Wright and the associate director of GAO's human resources division, Joseph F. Delfico, said that the Army alone contacted about 600 local groups across the country, but got little response.

"As it turns out, there were only two takers," Wright said.

Rep. Ted Weiss (D-N.Y.), chairman of the intergovernmental relations and human resources subcommittee of the House Committee on Government Operations, said, however, that he found the situation "just shocking." He criticized the Department of Health and Human Services for its role in arranging for food and shelter. The department was in charge of an interagency task force that was established to find federal aid for the homeless.

Wright defended the disbursements, saying that many of the military bases did not appear suitable as temporary shelters for the homeless. He said problems of transporting the homeless to the bases appeared troublesome and base commanders were requiring strict rules of operation that would only open shelters for limited hours.

"When Defense saw that it was not able to spend the entire $8 million on renovating the shelters," Wright explained, "it sent a letter of intent to the Congressional Appropriations Committee that basically said it would like to use the money to renovate facilities as shelters, but for defense purposes."

Wright said the committee apparently did not oppose the request and so the military received the go-ahead to spend the money for general maintenance.

Several members of the Community for Creative Non-Violence, all of whom are in their 19th day of a fast in protest of the Reagan administration's "antihuman" policies, attended the hearing.

Mitch Snyder, spokesman for the group and one of the District's leading advocates for the homeless, said the Pentagon's action reflects the White House's attitude toward the disadvantaged.

" The Department of Defense let that money slip through its hands because DOD has absolutely no desire or intention of housing homeless people," he said, "because the president of the United States has absolutely no desire or inten- tion of housing homeless people."

Snyder said things have a knack of getting done when the person in control wants them to.

"Nothing is moving now," Snyder said. " . . . All that's moving are people, from day to day, from bathroom to shower room, from soup kitchen to shelter. They are suffering and dying in numbers beyond our comprehension."