THE VOTE ON THE cargo-preference bill in the House on Wednesday was deeply heartening. It wasn't merely that a bad bill was decisively beaten, but that it was beaten for all the right reasons. Congressman recognized it as a particularly gross and inflammatory kind of protectionism.

The purpose of the bill was to require the delivery of a rising proportion of oil imports in American-flag tankers, the inflated costs of which make it impossible for them to compete in normal commerce. Rep. Sam Gibbons (D-Fla.). cited the infamous Smoot-Hawley Tariff of 1930, the damage that it did to other nations' economic stability, and the wave of foreign reprisals against it. "It started a trade war. It contained the seeds of what became World War II," Mr. Gibbons said. "We ought to be smart enough to learn something from history." "That is exactly the point. These issues of trade are not the mere dinky quarrels of narrow technical significance that their authors sometimes like to suggest. Trade laws can affect the whole course of world politics.

The defeat of this dangerous bill owes much to the attentions of a few energetic opponents - most notably Rep. Paul N. McCloskey (R-Calif.) - who had been tracking it for months. But the defeat also owes something to the candor of the bill's chief advocate and sponsor, Rep. John M. Murphy (D-N.Y.), who acknowledged that the limited cargo requirements in this legislation would only be the precedent for bigger things to come.

The afternoon's manuevering in the House demonstrated the salutary effects of a recorded roll call. When the bill was put to a hasty voice vote, it was whooped through. But when the same question was put to a recorded vote, it failed by the remarkable count of 257 to 165. The House collectively was prepared to let the thing slide through. But when members were required to stand up for it as individuals, a good many of them - rightly - had second thoughts.

Above all, the vote was a staggering defeat to the maritime lobby's abiding belief that money can buy just about any kind of legislation - no matter how outrageous. The lobby had given $150,000 to President Carter's campaign last year and in return got presidential endorsement for the bill. Common Cause, which likes to keep track of the relationship between money and legislation, published the totals in detail. The martitme lobby had given $44,410 to the 1976 campaigns of 215 of the present congressmen and naturally expected clear sailing in the House. That has always been the lobby's basic strategy: to lather, grease and butter every possible obstacle with that universal lubricant, money.

But there comes a point at which the money itself becomes the issue. The scale of the contributions becomes notorious. The suggestion of undue influence becomes pervasive. The manuever - and its goal - becomes disreputable. The whole carefully laid structure of contributions, favors, tips and benefactions collapses under the weight of too much money. That's what happened to the cargo-preference bill.