As speaker Thomas P. O'Neill played the role of Madame Defarge and the Democrats killed the last lingering hope that the Soviet outrage in Afghanistan had truly changed either the president or the House of Representatives.

O'Neill was ostentatiously taking down names of Democrats who dared vote for higher defense spending, dooming them to the congressional guillotine. vIt had been widely circulated that Democrats who so disobeyed the party whip would be made to pay when juicy committee assignments or subcommittee chairmanships are handed out next January. That conincided with the year's most aggressive lobbying effort by the Carter administration.

The unexpectedly top-heavy vote (246 to 164) against an amendment transfering $5.1 billion from social welfare to defense is important for what it tells about administration and congressional policy. President Carter is not only content with a post-Afghanistan budget that represents less for defense; he will fight for it. Moreover, his will has now been enshrined as a test of regularity for a party whose leaders the past helf-century have battled for defense preparedness.

With fervent lobbyists for CETA jobs and other social welfare programs invading Capitol Hill, the prevailing attitude toward defense was nonchalance. The infamous military-industrial complex did not even growl. Republican support for the amendment was halfhearted.

That opposition to arms would be enforced by the party whip was first suggested by the remarkable conduct of the Rules Committee when it considered The defense amendment sponsored by Republican Rep. Marjorie Holt of Maryland was cleared, but the name of its Democratic co-sponsor -- freshman Rep. Phil Gramm of Texas -- was removed. d

Nobody could remember such a personal insult. It was not only to remove bipartisan appeal from the amendment (which, in fact, was mainly Gramm's creation) but to send him a warning. His fellow Texan, House Majority Leader Jim Wright, has made no secret in the cloakrooms that he considers Gramm, a conservative economics professor from Texas A&M, an unacceptable Democrat. c

Soon after, President Carter opted for butter over guns. In his unexpected April 22 letter to Speaker O'Neill, he expressed himself as "strongly opposed" to the Holt-gramm amendment for "providing far more defense spending than is needed or advisable."

That echoed in Pentagon corridors, where solid complaints about money shortages for maintenance and techincal personnel -- long before the fiasco in the Irianian desert -- have been rising. There was disbelief when O'Neill announced the Pentagon could not use the extra money it so desperately wanted. a

Word circulated on Capitol that Defense Secretary Harold Brown had been asked to write the speaker a letter confirming his ridiculous claim. What would the cool, brainy Dr. Brown do? Follow Cyrus Vance out of the Cabinet on principle? Or join his chief and party in downgrading defense?

Characteristically, Brown split the difference. While not indulging O'Neill's talk about unusable money, he did send the speaker a letter endorsing "a balanced budget to help fight inflation and the proper claims for social programs" amd opposing Holt-Gramm. In short, a qualified surrender by the secretary of defense.

That removed the military half of the military-industrial complex. The industrial half was never there. Accustomed to looking our for their own line-item hardware, defense industry representatives did not bother to counter the massive force against defense spending arrayed by social welfare groups, organized labor and the administration. Even Treasury Secretary G. William Miller was pressed into service begging votes against defense.

While only 49 Democrats braved Madame Defarge, expected Republican solidarity disintegrated. Worse even than 34 disintegrated. Worse even than 34 defecting Republicans (led by the influential Rep. Barber Conable New York) was the ho-hum attitude of the opposition.

Over in the Senate, defense-oriented Democrats were appalled. Sen. Ernest Hollings of South Carolina, the new budget committee chairman, referred to "monkeyshines" on defense by the administration. Sen. Sam Nunn could not understand how a defense budget supposedly considered inadequate by his fellow Georgian before Afghanistan now had become perfectly adequate.

The budget resolution may well lose in the House to a coalition of liberal Democrats, who want more domestic spending, and conservative Republicans. But the May Day message from Washington will not be erased. Rep. Sam Stratton of New York, one of the brave 49 Democrats to ignore the party whip, told the House: "The fact of the matter is that America is viewed as weak, as hesitant, as indecisve." His colleagues confirmed that view May 1.