The House debate on President Reagan's secret war in Nicaragua was not just the most impassioned in recent memory. It actually changed votes.

Rep. Wyche Fowler Jr. (D-Ga.), who is anti-war, said just before the final roll call, "I have never seen more undecideds. Members were looking for reasons to vote with the president and reasons to vote against us. The Republicans didn't give them a thing, and I guess we didn't make any mistakes."

The Republicans, beginning with Reagan, were quick to claim that the result, a decision to cut off funds for the "contras" who are trying to overthrow the Sandinista government, would make no difference, because the Senate would not agree.

But to understand what a difference it made, you have only to think of what it would have meant if the decision had gone the other way. Reagan would have had a green light for more military adventures, would have felt vindicated in his dispatching of an armada and 3,000 to 4,000 troops to the area.

It made a difference in Latin America, where the word that not all Americans believe they own the hemisphere is always welcome. It showed that the House, which has so often caved in, as on the MX missile, before a show of presidential will, can cast off its fears and match its judgment with his on a question of foreign policy--particularly one that involves, as many said, "what America really stands for."

It showed that Vietnam is a livid memory for Democrats who wandered into it under "strong" presidential leadership.

"Who will fight this war?" cried Rep. Robert Garcia (D-N.Y.) in one of the long night's most dramatic moments. "Look at the number of people who died in Vietnam. Most of those were poor young men and women who were brought up in the ghettos of this country."

As the night wore on and the Republicans began to see that, for once, the Democrats were organized and united and gathering strength as they went, Rep. Newt Gingrich (R-Ga.) tried red-baiting, a certain sign of bankruptcy.

He excoriated the remarks of Rep. Thomas J. Downey (D-N.Y.), who called "our" side in Nicaragua "thugs, thieves and brigands." Gingrich called to account those "who honestly believe the CIA is more dangerous than the KGB."

The Republicans cheered. And Rep. Ted Weiss (D-N.Y.) demanded the floor.

"Mr. Gingrich indulged himself in rhetorical excesses, which he might want to reconsider and withdraw," Weiss said. "Those members who applauded those statements might want to reconsider."

"Does the gentleman really believe there are any members who think better of the KGB?" he asked, rhetorically.

Rep. Thomas F. Hartnett (R-S.C.) stood up to be counted.

"The gentleman from South Carolina says he does," Weiss said. "But I think that questioning the loyalty of members on either side is reprehensible, shameful and despicable and has no place in this body."

The Democrats gave him a standing ovation.

To the House minority whip, Rep. Trent Lott (R-Miss.), the turbulent evening was clearly explainable in terms of the defection of a once dependable hawk, House Majority Leader James C. Wright Jr. (D-Tex.).

"Jim Wright was co-opted by the radicals of his party. Usually Jim is a man who can be reasonable and find a compromise. But he has been captured by extremists," Lott said.

Wright had become a tiger against secret aid. Although he reportedly feels personally betrayed by the Sandinistas, Wright has been under instruction from freshmen members who think there is a difference between Republicans and Democrats. After the first Democratic capitulation on the MX, they forced a caucus and delivered the unspoken message that if Wright wants to be speaker, he must be more liberal. He changed on the MX and Nicaragua, attended every whip meeting and faithfully worked through the list of waverers that was presented to him.

The administration had courted him on a compromise. It was their usual kind. In exchange for continuing the war--they would not stop it for 30 days or even three--they offered the nebulous benefit of "bipartisanship." Wright did not buy.

The chairman of the House Intelligence Committee, Rep. Edward P. Boland (D-Mass.), the sober, patriotic World War II veteran who has never sought a confrontation with the CIA, played a major role.

"It wasn't some wild radical out there leading the charge," said one of his colleagues. "Eddie would go to a member's office and say, 'You know me, I'm not a nut. I'm telling you this is wrong, and it's illegal.' "

Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), who does not like to buck the president on foreign policy, was galvanized by Reagan's martial moves. He was heard to mutter that Reagan "thinks he's John Wayne, thinks he can go down there and clean the place out."