WHERE SHOULD the next federal dollar be spent in a tight budget era? Senate Republicans would spend at least part of it on the better-off elderly. That's not the way their proposal is wrapped, but that's what it amounts to. As S. 10, one of the party's five highest priorities in the new Congress, minority leader Bob Dole has urged the partial repeal of the Social Security earnings tests. What sounds like a worthy idea is in fact an awful one.

The earnings or retirement tests are indexed limits on what Social Security recipients can earn without having their benefits reduced. The limits and rates of reduction vary with age and beyond age 70 do not apply. Recipients ages 65 through 69 can earn $9,720 this year, after which their benefits are reduced $1 for every $3 earned. Many in Congress have long urged repeal of the test. They contend that many elderly recipients need the money, that it is counterproductive and wrong to penalize and deter willing workers (and taxpayers) and that society needs the experience and skills.

But Social Security is not a reward for attaining a certain age; it is insurance against loss of income in retirement payable only when retirement occurs. The retirement test doesn't mainly squeeze the elderly with marginal incomes in whose behalf repeal is urged; they are stalking horses. The principal beneficiaries of repeal would be well-off recipients who would continue to work anyway. In 1986 only 10 percent of persons 65 to 69 eligible for benefits were affected by the earnings test, and two-thirds of those had incomes over $30,000 a year.

The cost of helping mainly these people who don't need the help would eventually be more than $5 billion a year. Mr. Dole would mask and reduce this by repealing the test in stages; the valid point is made that some of the cost (the Social Security actuaries estimate 10 to 20 percent) would be recovered in income and payroll taxes. Advocates also say that repeal wouldn't add to the relevant deficit, since Congress has decided that flows in and out of the Social Security trust funds shouldn't count any more -- and some point out that the new budget rules protect against the draining of the trust funds.

But budget rules are scant protection against a proposal to be generous to the elderly in a presidential election cycle, and in the real world of what the government has to borrow each year, the drawing-down of the Social Security surplus counts against the deficit no matter what accounting rules Congress adopts. For years Mr. Dole and the Senate Republicans generally were leaders in the effort to contain the budget deficit; it made them few friends. Only three months ago they finally succeeded; now they propose to breach that good agreement for the worst of reasons. Some Democrats are also tempted. They should resist.