The U.S. District Court here set the stage yesterday for a possible rerun of the 1980 election to detemine who will be president of the American Federation of Government Employees, the largest federal-sector union.

Judge John Lewis Smith Jr. took the Labor Department to task for the agreement it made with AFGE leaders in the wake of complaints from supporters of defeated candidate Carl K. Sadler that many delegates to the union's 1980 convention in Honolulu had been selected improperly.

The Labor Department had said that while it found numerous noncriminal violations in the selection and certification of delegates, it was not worth asking the AFGE -- which will hold another presidential election in New York in just 13 months -- to rerun the August 1980 race. Instead AFGE and the Labor Department agreed that delegates to the 1982 New York convention will be selected, and the election itself supervised, by the Labor Department.

AFGE has about 300,000 members whose votes are cast by delegates selected at meetings of the AFL-CIO union's 1,450 locals. Sadler had challenged incumbent AFGE President Kenneth T. Blaylock, who is also a member of the AFL-CIO Council. Blaylock got 102,198 delegate votes at the AFGE convention compared with 93,229 for Sadler. Sadler supporters immediately contended that certain delegates who could cast as many as 40,000 votes had not been chosen properly by union locals.

Earlier this year the Labor Department investigated the charges.Richard Hunsucker, director of labor-management services for the department, said that although his investigatros found "violations which could have affected the election," a rerun was not practicable because almost half of Blaylock's two-year term had been served. He said if the term had been for three or five years, the department probably would have ordered a new election. t

In his decision yesterday, Judge Smith said the Labor-AFGE agreement ws not remedial in nature because it did "nothing to remedy the violations which may have occurred in 1980" and, in effect, "validates the election without regard to its legality. . ."

He ordered the department to submit the original charges to an administrative law judge, to get a recommendation from the judge within 90 days and to prepare for a possible election rerun if the administrative law judge so recommends and the assistant secretary of labor concurs.