A study by the Virginia General Assembly's investigative panel has found that physicians and dentists who work in the state's prisons were paid $602,319 last year for time not worked.

The report by the Joint Legislative Audit and Review Commission, the latest salvo at the state's much-criticized penal system, found that corrections personnel were allowing staff physicians and dentists "to work less than the required hours as an incentive for employment." Many of the doctors were working at second jobs outside the prisons when they were supposed to be inside the state's facilities, the report charged.

As a result, commission said, Virginia paid 31 doctors and dentists for 21,072 unworked hours in fiscal 1985.

The commission recommended that the Department of Corrections stop the payments and "explore the possibility of contracting for more physician and dental services."

Gov. Gerald L. Baliles, who said last week he has happy with the progress of changes in the prison system, said today he was concerned by the report, which he had not yet seen. The governor said he will discuss it with Transportation and Public Safety Secretary Vivian E. Watts, who said she will discuss possible legal actions against the doctors to recover some of the payments.

Legislators also reacted with concern. "That's just poor management," said Del. Frank M. Slayton (D-Halifax). Sen. Stanley C. Walker (D-Norfolk) found the report "somewhat shocking . . . an alarming thing," and Sen. Dudley J. (Buzz) Emick (D-Botetourt) said "it upsets me. I thought they had put in better management practices."

Watts said she, too, was "distressed," but said an attempt to force the doctors and dentists to "be there at assigned hours, and to agree to firm oversight and accurate reporting" could mean losing some doctors.

Watts said she will ask state Attorney General Mary Sue Terry to explore whether any of the overpayments can be recoverd.

Watts said she discussed the report with Corrections Director Edward W. Murray. Murray declined to comment, but his top aide, L. Duncan Brogan, said, " . . . If someone is getting paid 40 hours, he ought to be working 40 hours."

Raymond Kessler, health service administrator for the corrections department, said his agency "has no control over the hours doctors work. The physicians are employed by the individual institutions, and are subject to conditions, including working hours, like all other employes.

"I do know that some don't work 40 hours," Kessler said. "Their agreements compensate them for being on-call at night and on weekends, and for performing other favors. If those considerations are included, along with time off to attend seminars, then obviously they are not working 40 hours."

Of the 10 major institutions covered by the report, the two that have infirmaries to handle more serious cases and provide temporary convalesence -- Powhatan Correctional Center west of Richmond and the State Penitentiary here -- had the largest amount of unworked hours.

The report was part of an overall study of staffing needs in the state's prison system. The good news, Watts said, is that commission recommended hiring an additional 108 employes, most of them in nonsecurity posts at minimum-security prisons.

The report also found that the department spent $1 million for data processing equipment to automate accounting, but didn't use some of the equipment for as long as a year.