While the government preaches medical cost-saving, military and veterans hospitals often stand almost cheek-by-jowl without sharing the expert staffs and sophisticated equipment that cost billions.

The result, General Accounting Office officials have told Sen. Charles H. Percy (R-Ill.), is wasteful spending to the tune of at least "hundreds of millions."

A staff report to Percy -- to be disclosed at a hearing before the Senate Governmental Affairs Committee Wednesday -- gives these examples:

The Navy spends $25 million a year at Great Lakes, Ill., to operate a partly empty hospital, with usually only 120 beds filled. At North Chicago, two-thirds of a mile away, the Veterans Administration plans to spend $25 million in coming years to renovate its aged hospital. VA patients cannot use the empty Navy beds.

The VA has an ample supply of doctors at its North Chicago hospital, thanks to a medical school affiliation. With some exceptions, they cannot treat Navy patients, while a doctor shortage forces the Navy the spend $3 million a year for part-time private sector doctors and privatea sector care.

For lack of a VA-Army agreement to share Boston VA orthopedic services, the Army flies "dozens of patients from Boston to Walter Reed Hospital in Washington on its very expensive air evacuation system."

San Diego Naval Hospital eye patients cannot be treated with a nearby, often idle, VA laser. The Navy is planning a new $293 million San Diego hospital "without any coordination" with the nearby VA hospital.

Congress' General Accounting office set out many more examples of lack of hospital sharing in 1978 report, one of 16 it has made on the subject.

But the sharing between the two largest federal systems -- the VA with 171 hospitals and the Defense Department with 129 -- remains "minuscule," according to the report to Percy by special assistant Alan Mertz.

In fiscal 1979, the VA had 20 sharing agreements with other health facilities, with $20.1 million in services being exchanged. But only four of the 240 agreements were with military hospitals, the report to Percy says.

The reasons why, says the report, include old legislation that prevents VA-military sharing in many cases; cumbersome regulations in other cases; official jealousies and, among the most serious obstacles, a huge financial disincentive.

If a hospital administrator agrees to provide a costly service, the money goes to Washington, not the providing hospital.

Percy has introduced a bill to eliminate many of these obstacles. He said yesterday he has received "enthusiastic support" from many federal hospital administrators and expects support on Wednesday from several military and VA medical officials.