Internal Revenue Service Commissioner Roscoe L. Egger Jr. said yesterday that Prince Edward Academy, the private Virginia school that became a symbol of resistance to public school desegregation, recently won tax- exempt status from his agency because of a bureaucratic error.

Egger told the House Ways and Means oversight subcommittee that he had been unaware of the decision until he read news reports of the action last month. He stopped short of saying that the controversial decision will be overturned, but he said it was under review and that the IRS will soon announce its findings.

The disclosure last month that the IRS had restored tax-exempt status to the Farmville school prompted protests from civil rights groups and others. The academy was created after public schools in Prince Edward County were closed in 1959 as part of Virginia's "massive resistance" to desegregation.

The private school still has no blacks among its 650 students, but it won the IRS ruling after it published a statement declaring that it would not discriminate on racial grounds.

"This is a case of some national cause celebre," said Rep. J.J. Pickle (D-Tex.), who called yesterday's hearing. "It has a great bearing on what happens throughout the nation."

Egger said, however, that the decision was not politically motivated or designed to change IRS policies on tax exemption for racially discriminatory schools. It was the product of a foul-up by a "determination specialist," a GS-11 employe in the IRS' Baltimore district office who failed to follow proper procedures, he said.

"It's not enough to say an error was made in the district office," Pickle said. "I accept that . . . . But now that you know . . . I do not think we ought to treat it lightly."

Egger promised to expedite the agency's review, but he said he was forbidden by law to discuss it. He said that a school with a segregationist past ordinarily would not get its tax exemption restored simply by publishing a newspaper advertisement stating a policy of nondiscrimination.

Tax-exempt status is crucial to many private schools, because it frees them from federal tax liabilities and allows supporters to make tax-deductible contributions to them.

While the school, which lost its tax-exempt status in 1978, has no black students or teachers, John William Crews, a Richmond lawyer for the school, testified yesterday that it would accept them if they applied.

Egger said decisions on tax- exemption cases involving allegedly discriminatory schools formerly were made in the IRS headquarters in Washington. But the Reagan administration decided to decentralize the process after the Bob Jones University case, according to Egger.

In that 1983 case, the Supreme Court repudiated the Reagan administration for trying to revoke a longstanding IRS policy of denying tax-exempt status to that South Carolina college and 110 other allegedly discriminatory schools.

Rep. Charles B. Rangel (D-N.Y.) said yesterday that he was concerned that the administration might be trying to circumvent the court decision by granting tax-exempt status to such schools without proof that they are no longer discriminatory. He questioned the wisdom of allowing such decisions to be made by staff members who might be subject to local pressures.

Egger said he has never directed anyone to make a ruling favorable to racial discrimination, adding that the IRS decided to decentralize because of an enormous backlog. He said the IRS is reviewing those procedures.

Of the 111 private schools that had their tax exemptions revoked on the ground of racial discrimination, 14 have regained tax-exempt status, including Prince Edward. Seven other applications are pending, according to Egger.

The Prince Edward decision was supposed to be reviewed by a local review panel before a final decision was issued, the IRS commissioner said. But that mandatory review was not done. The local review staff is then supposed to refer the case to the national office, he said.