The General Accounting Office has ruled that the District of Columbia violated federal procurement regulations when it bought $647,000 worth of voting equipment from a California firm without taking competitive bids.

The city would have saved $72,900 if it had gotten the same deal as Montgomery County did when it bought similar equipment from the same firm, the GAO report indicated.

The GAO, the congressional watchdog agency, investigated the purchase when a rival firm filed a formal protest. The GAO issued its strongly worded eight-page criticism of the city last week.

The GAO rejected a contention by the D.C. Board of Elections and Ethics that it had conducted "an exhaustive study and comparison" of various balloting devices before deciding last June 20 to adopt the Datavote punchcard system.

"Clearly," the GAO declaed, "The District never defined its minimum needs with any of the required specificity in order to make a rational decision . . ."

The GAO also rejected the board's position that it had to act fast, and skip competitive bidding, because only San Francisco-based Datavote could have supplied suitable voting devices in time for the city's Nov. 6 school board election.

Federal rules do not prohibit buying items from a preselected seller, such as the maker of Datavote.But they do require a showing that only that seller can meet the government's requirements.

Despite the advent of home rule in 1975, the GAO said, federal procurement rules still apply to the city.

At the time of the election board's decision, the city had $650,000 available to buy the devices. The appropriation by Congress would have expired if the money had not been obligated by the end of the fiscal year, Sept. 30.

The GAO said the city acted so swiftly after the election board's decision that it may have paid an excessive price for the devices. It paid $195 for each of 1,620 units, while Montgomery County negotiated a price of $150 for similar devices. At Montgomery's price, the city would have saved $72,900. The system also includes a computerized voter registration program.

In an opinion signed by its general counsel, Milton J. Socolar, the GAO said it would have recommended cancellation of the contract if the election system had not already been delivered.

The most GAO can do now, the report said, is to call "the numerous shortcomings" to the attention of D.C. Mayor Marion Barry so he can make sure they are not repeated.

The GAO said there was no evidence that the Diamond International Corp., maker of Datavote, was involved in improprieties.

The conclusions of the GAO ruling paralleled those in a report issued Sept. 14 by D.C. Auditor Matthew S. Watson. Watson held that the procurement violated the D.C. government's own purchasing rules, which vary somewhat from the federal regulations cited by the GAO.

Watson also said the city paid its bill from Datavote so fast that it lost $5,000 in interest it could have earned if it had waited the normal 30 days after billing.

The GAO investigation was sparked by a protest from Computer Election Systems Inc., another California firm, which manufactures the rival Votomatic ballot system.

Both Datavote and Votomatic use a system in which ballots are placed in small devices that resemble desk staplers, which voters use to punch rectangular holes after the name of the candidate they favor. These are fed later through counting machines, which produce computerized tally sheets.

Datavote was tested in Ward 4 in the November 1978 mayoral election and citywide at the May 1 special council election, with devices supplied free of rental costs by the manufacturer. Election officials pronounced themselves pleased with the results.

On June 20, James L. Denson, then a member and now chairman of the three-person board, recommended the selection of Datavote. He was joined in a 2-to-0 vote by Jeanus L. Parks Jr., then the acting chairman, who later resigned. The third seat on the board was vacant at the time.

The order was promptly placed by the D.C. General Services Department, the city's procurement agency. The GAO said the department did not conduct an independent analysis of the noncompetitive purchase decision.

"We do not fine the (city's) experience of using a system for two elections [Datavote] as opposed to a one-hour demonstration before the Board [Votomatic] to have been a fair comparison," the GAO reported.

The GAO also said "there is no evidence in the record that the District ever made any inquiries about any other firm's delivery capability" in time for the Nov. 6 election. Contrary to what the election board said, the GAO contended there was ample time to seek competitive bids.

Denson could not be reached yesterday for comment. When city auditor Watson's report was issued in September, Denson strongly defended the board's decision to buy from Datavote and deplored what he called "innuendoes of impropriety" that Watson's report contained.

Carroll Harvey, acting director of tthe General Services Department, said he would not comment until he read the GAO report. Harvey said he disagreed with Watson's earlier conclusion that city procurement rules were breached.