Bowing to a quirk in the election law and recent court decisions, the D.C. Board of Elections and Ethics has decided to print primary election ballots for two tiny leftwing political parties that have only 68 registered voters between them.

There is no indication that there will be a primary contest at the Sept. 12 election in either of the two political organizations - the Socialist Workers Party, which has 45 registrations, and the United States Labor Party, which has 23.

On that same day, voters will settle the hard-fought rivalries in the city's dominant Democratic Party, which has more than 175,000 registrants, as well as choosing candidates for the smaller Republican Party, with 22,000, and Statehood Party, 1,800.

Mary S. Rodgers, elections administrator for the electoral board, said the city election law provides for a primary election in any party whose top-vote getter in the last general election received more than 7,500 votes.

Candidates of both the Socialist Workers and U.S. Labor parties met the criterion in 1976.

Rodgers recommended last week that the board exercise its apparent legal power to waive primaries for the two parties, saving several hundred dollars in ballot printing costs and making it easier to conduct the Sept. 12 election.

Under the procedure, the board could declare any uncontested individuals seeking to run on either party ticket as the party's nominees, automatically putting their names on the Nov. 7 general election ballot.

The board has done so in the past. In 1974, for example, it declared Sterling Tucker, who was unopposed for City Council chairman, to be the Democratic nominee for the post, and Jackson R. Champion, similarly unopposed, to be the Republican nominee for mayor.

Winfred R. Mundle, the electoral board's general counsel, recommended against that procedure this year.

Mundle said in a formal ruling last week that courts in recent years have required that voters be given the opportunity to write in the names of candidates if they choose. He also said the courts have held that making a government agency's job easier is not a good enough reason to take legal short-cuts.

"To declare a winner prior to election day percludes the (potential) candidate from . . . waging a write-in campaign which, if succesful, would result in the party nomination to the general election," Mundle wrote.

After hearing both sides, electoral board members Shari B. Kharasch and Jeanus B. Parks told Rodgers to have the ballots printed for the two small parties.

As of June 14, according to Rodgers, only two Socialist Workers Party members had taken out nominating petitions - Glova E. Scott for mayor and Antonio J. Grillo for the Ward 1 council seat. Nobody had sought to run for office on the U.S. Labor ticket.