A U.S. District Court judge ruled yesterday that last year's Washington Teachers Union elections were improperly conducted and ordered new elections to be held for president and seven other top officers of the 4,200-member union.

In a written order, Chief Judge Aubrey E. Robinson Jr. said the May 1981 elections, challenged by a losing candidate for president, were not conducted by secret ballot as required by federal law, and ordered the Department of Labor to supervise new elections. Robinson said the lack of secret balloting at 11 of 12 polling sites at area high schools may have affected the outcome of the election.

Robinson said that the union at almost all polling places made no provision for voters to mark their ballots in private--through setting up partitions or booths--and included no instructions for poll workers to tell each voter to vote in private.

Union President William H. Simons, who has headed the union since its founding 17 years ago, easily won reelection to a two-year term, beating his challenger, Ballou High School chemistry teacher James D. Ricks, by a vote of 553 to 338. Despite the wide margin, it was a bitterly fought contest and the stiffest challenge to Simons' leadership.

Ricks, who had lost to Simons in two earlier elections, filed a complaint first with the teachers union and with its parent organization, the American Federation of Teachers. When neither group acted within the period set by federal labor law, Ricks took his complaint to the Labor Department.

Department investigators found "probable cause" to believe the union violated provisions of the Landrum-Griffith Act governing union elections and asked that the results be overturned, according to a complaint the department filed last December.

In an interview, Ricks said he would challenge Simons again and predicted that greater secrecy would persuade many more voters to turn out for the elections. Ricks, chairman of the science department at Ballou, said that during the last election, "people were able to look over shoulders" and see for whom people were voting. Ricks said he believed that many teachers "did not come to vote because they were afraid of voting against Simons, since he had been president for so long."

A worker at the teachers union offices yesterday afternoon said that Simons would not be returning any telephone calls.

Since becoming president in 1964, Simons has been viewed by many teachers as a father figure, a personification of the union itself. Through the years, he has gained supporters by defending teachers against educators and politicians who sought to blame the school system's ills on its teaching staff. His detractors have accused him of being arrogant, abrupt and condescending.

Although Labor Department investigators questioned several aspects of the conduct of the elections, the only issue presented during a four-day trial before Robinson last month was whether the balloting had been secret.

Simons has said that he was not aware of any complaints that anyone had been forced to change his or her vote. But in his written order, Robinson said that the union had failed to show that "the violation did not affect the outcome of the election."

Robinson did not specify a date for the new election, but a Labor Department spokesman said yesterday that department officials would begin working with the union to set up an election as soon as possible. Department officials said they had not reviewed Robinson's order and could not predict when an election would be held. The next regularly scheduled election would be in May.

A Labor Department spokesman said last night that Simons would continue as president until a new election.