In Boston, the city's police and fire departments, found to have discriminated in hiring unintentionally, were ordered by the court to hire more blacks and Hispanics. This they did, only to be later forced by a tight budget to lay some of them off.

The standard used was seniority--first hired, first fired--and so a disproportionate number of blacks and the Hispanics were sent home. They went, instead, to court--and they won.

As a result, the city of Boston was told that in order to maintain a proper racial and ethnic balance in the police and fire departments, it would have to suspend the seniority standard and fire some whites. This it did, and now the whites are suing.

Into this legal morass has stepped the Reagan administration, whose insensitivity when it comes to civil rights is virtually legendary.

It has intervened in the Boston case on the side of the whites, saying that discrimination is discrimination no matter what the color of the victim. The president put it this way: "I'm old enough to remember when quota systems . . . were used, not to end discrimination, but actually to legitimize it."

Once again, the president could be faulted for a lack of sophistication. In the Boston case, discrimination is being used not to keep a minority "in its place," but to help it out of the miserable place discrimination has put it in.

And the idea is not to hurt whites because they are white, but instead to help blacks and Hispanics.

Nevertheless, the president is right. Any way you cut it, the whites will get hurt on account of their race--an arbitrary standard having nothing to do with merit. While there is, in the words of the court, "nothing magical about seniority," it can bear on merit and it is not, at any rate, the explosive issue that race is.

No kid ever got beat up in a school hallways because his dad had seniority.

The president is right also because these white firemen and policemen are not the ones who administered the tests whose unintended result was overwhelmingly white police and fire departments--departments whose racial and ethnic composition did not come close to reflecting Boston's.

The discharged police and firemen did not hire themselves, and it is unfair that they should be penalized--some of them after 10 years of service--for something they did not do.

It is one thing to prefer someone because of race; it is quite another thing to fire someone for the same reason.

A case can be made for affirmative action, but it is more of a tactical one than a legal one. As redress for past discrimination, it has some utility. It undoubtedly improves the economic situation of the person hired and that person might serve as either a role model or an inspiration for others.

All that would be worthwhile--if it did not come at the expense of someone else or if the person hired was the one who earlier got turned away. Most of the time, though, it's someone else entirely.

The president did not go into any of this in defending the Justice Department's decision. Instead, in his own way, he was articulating a basic tenet of the American creed--that every individual will be judged on merit.

Of course, that does not always happen. And there have been times when that almost never happened. But as a goal, it is a splendid one--the unwritten promise America has traditionally extended to immigrants.

It would be better to ensure that the goal is always met rather than to suspend it temporarily in the name of a higher purpose--especially when the purpose is not higher at all, but just another way of achieving the same end.

The danger is that affirmative action institutionalizes the concept that when the cause is worthwhile, it is permissible to discriminate. Every bigot, though, thinks that his cause is worthwhile.

The Reagan administration has a sorry record when it comes to civil rights. But that does not mean that sometimes, even for what might be the wrong reasons, it can not stumble onto a principle worth defending. It has done so in Boston.

The end does not justify the means. It only ensures that someone will use the same means to reach a different end.