Theodis R. (Ted) Gay, a low-key political technician who helped erase the local Democratic party's debt, was elected last night to a second two-year term as chairman of the D.C. Democratic State Committee.

Gay, who angered Mayor Marion Barry last fall by discouraging the state committee from endorsing the mayor until after the Sept. 14 Democratic primary election, headed a slate of five incumbent officers who ran unopposed.

Vice Chairwoman Barbara Bell Clark, Treasurer Walter E. Beach, Recording Secretary Paul Kuntzler and Corresponding Secretary Barbara Lett Simmons also were elected.

Barry privately boasted after his reelection that he would wrest control of the local party organization and dump Gay. But Gay, 40, an affable operator of an art framing shop, managed to solidify his hold over the party and discourage a challenge. Still, eight of the 46 committee members who took part in last night's voting opposed Gay.

Gay said later that a handful of dissidents members are unhappy with the way the committee resolved two recent internal party disputes in Wards 7 and 8.

Lorraine H. Whitlock, one of the mayor's chief political allies in Ward 7 and a member of the committee, said the local party hasn't done enough under Gay to recruit and politically educate new members.

"We're supposed to be party building, and I think there is room for improvement," Whitlock said. "But Ted can't do it by himself. There has to be a new thrust by members."

Beach, the party treasurer, said Gay's major achievement has been to eliminate the $35,000 party debt he inherited two years ago. Today, the local party has a $14,000 surplus.