AS THE demonstration at the Pentagon ran its zestful course last Sunday, the memories flooded back. Ten years and a day had passed since another anti-war demonstration came close to shutting down the government and impairing the life of the city. The speeches of those two May Day affairs were similar -- at times last Sunday it seemed we heard it all before -- but the spirit was vastly different.

One policeman, a veteran of the two demonstrations, said that this time "the anger was gone." And so it seemed to be, on both sides.Last Sunday's affair was a model of peaceful protest against a government's policies. The other, a decade ago, was a disaster -- for the demonstration, the government and the city.

Part of the difference, no doubt, arises from the prologue. May Day 1971 was the culmination of years of dissatisfaction with the war in Vietnam. May Day 1981 was a protest against policies of recent origin that have yet to evoke deep stirrings.

But we would like to think that part of the difference also arises from the lessons that are available from the events of a decade ago. One of those, for demonstrators, is that non-violence is likely to breed more support than violence. Another, for government, is that insecurity and overreaction can create a setting in which violence becomes almost inevitable.

Perhaps it was fitting that last week Judge William B. Bryant signed an order that may finally bring to an end the legal aftermath of that earlier affair. He approved an agreement under which the government will pay amounts ranging from $750 to $2,550 to more than 900 of the 1971 demonstrators for the way they were treated by police.

Those are the 900 demonstrators who were arrested on the steps of the Capitol where they had been listening to a speech by Rep. Ronald V. Delums. They won the $2.2 million judgment for violations of the right of free speech and for false arrest and imprisonment.

That mass arrest seemed strange then, quite different from the thousands of arrests made on the first wild day of the unforgettable week when police wrestled with mobs for control of the city's streets. It seems even stranger now. In retrospect, however, it grew out of the anxiety of a government fearful of the impact of well-publicized protest.

The truth is that a protest like the one conducted here last Sunday -- carried off with zest, protected by the police and devoid of violence -- is a demonstration that the political system is working the way it should. Those who made policy should listen to the message thus delivered, whether or not they are persuaded by it, instead of trying to suppress it, as did the policy-makers in 1971