If the Democrates were doing as well in the country as they are in the courts, they would be in great shape. And if the voters of the country understood the importance of the political parties as well as the justices of the Supreme Court do, then some of us could quit worrying about the condition of the two-party system.

For the second time in six years, the learned justices have handed the Democratic National Committee a clear verdict on a vital question testing the authority of the party to control its own nominating procedures -- even in conflict with state laws.

Last week's 6-3 decision on Democratic Party of United States v. La Follette , following the unanimous 1975 decision on Cousins v. Wigoda, ought to convince even the skeptics that party rules will be enforced against those who wish to challenge them.

The issue in the 1975 case was the right of the 1972 Democratic convention to unseat the duly elected Daley delegation from Chicago and substitute delegates who met the party's own rules on the representation of women and and minorities. The issue last week was the party's right to reject delegates instructed by the results of the Wisconsin "open primary." Wisconsin has a long tradition of allowing Republicans and independents to cross over into the Democratic primary -- and vice versa -- while the Democratic National Convention rules require that delegates be picked only by bona fide Democrats.

In the earlier case, Justice William J. Brennan Jr, upheld the convention decision against state law because, he said, "the convention serves the pervasive national interest in the selection of candidates for national office, and this national interest is greater than any interest of an individual state."

Because "delegates perform a task of supreme importance to every citizen of the nation," Brennan said, no single state may be permitted to dictate terms for its delegates that "could seriously undercut or indeed destroy the effectiveness of the national party convention as a concerted enterprise engaged in the vital process of choosing presidential and vice presidential candidates."

In last week's ruling, Justice Potter Stewart applied and reinforced the same doctrine, "The state argues," he said, "that its law places only a minor burden on the national party. The national party argues that the burden is substantial, because it prevents the party from 'screening out those whose affiliation is . . . slight, tenuous or fleeting,' and that such screening is essential to build a more effective and responsible party."

"But," said Stewart, "it is not for the courts to mediate the merits of this dispute. For even if the state were correct, a state or a court may not constitutionally substitute its own judgement for that of the party."

The latest ruling came just as the Democrats were choosing Charles T. Manatt Jr. of California as their new chairman and facing the task of rebuilding from their latest and worst electoral defeat.

The justices clearly signaled the Democrats that the way is open for them to begin the repair of their own distorted nominating process by curbing the number of delegates chosen in primaries. States may hold primaries according to their own laws, the court said, but the party is obliged to seat delegates only in the manner and number its own rules prescribe.

The task of changing those rules to reduce the percentage of delegates picked in primaries will not be easy, but it is vital. Women and minorities may well object to any reduction in the "participatory" politics of the last 12 years. They are entitled to consideration, because they been the most loyal of all the Democratic constituencies.

But the Democrats face one overwhelming fact. Since they rewrote their nominating procedures in 1969 and thereby unleashed the flood of primaries, they have nominated two candidates -- George McGovern and Jimmy Carter. In the last three presidential elections, their scorecard shows one narrow victory -- over an appointed president carrying the banner of a party that had just gone through the worst political scandal of modern times -- and two landslide defeats.

The country will rightly judge the political wisdom of the Democrats by their ability to make the necessary connection between the distortions of their nominating process and the disasters of their presidential candidates.

The Supreme Court has ended any doubts about the Democrats' right to reconstruct their own convention and nominating system by changing their own party rules. The political imperative for changes that would reduce the number of "grass-roots" delegates and increase the influence of officeholders and party professional is clear.

If the Democrats fail to act in the next two years, it can only mean they have less respect for the importance of their political convention than those nine men on the Supreme Court display.