WE CAN ONLY hope that the Carter administration doesn't handle all the nation's business the way it has dealt with the problem of replacing David W. Marston, the Republican U.S. Attorney in Philadelphia. It wasn't, on its face, all that big a problem. Mr. Marston was himself a pure product of the patronage system, appointed out of Republican Sen. Richard S. Schweiker's office in the waning days of the Ford administration, with no background as a prosecutor or even as a practicing lawyer. It should not have been difficult in the early days of the Carter administration to find a Democrat with better credentials than those of Mr. Marston - one who could have easily met the test of "merit" that Jimmy Carter had laid down in his campaign. But local Democrats had somehow not caught the spirit of the President's campaign promise. The candidate they came up with last March was apparently so clearly unqualified that the administration would not go along. So far, score one for integrity and the keeping of campaign promises.

Almost immediately, Mr. Marston began to complicate the problem by making an admirable record as a hard-charging prosecutor. In the process, he acquired a loyal local following. But because he was mostly engaged in prosecuting and investigating Democrats, he also acquired a lot of local enemies. Finally, Philadelphia Democratic congressman, Joshua Eilberg, was caught up in Mr. Marston's investigatory net. Last November, the congressman called Mr. Carter to say that Mr. Marston had to go - quickly . The President apparently passed that message along to Attorney General Griffin Bell.

At that point, did the Attorney General look into the matter, discover that Mr. Elberg had a personal interest in Mr. Marston's removal, and take steps to protect his chief from the inevitable cries of "coverup"? Did it not occur to somebody in the White House or the Justice Department that the President, given his campaign pieties about the appointments on "merit," had a problem? Apparently not. At hispress conference 10 days ago, he said he had only "recently" become familiar with the case - a statement that was, at best, misleading. Under pressure, he was later forced to concede that he had heard of it from Rep. Eilberg in November, and had actually talked about it with the Attorney General before that. But he insisted that he knew nothing about the Marston/Eilberg connection. Let us assume that this is so. Let us further assume that the President was simply confused when he subsequently left the false impression with congressional visitors that Justice Department officials had found no evidence that Mr. Eilberg, and a fellow Pennsylvania House member, Rep. Daniel J. Flood, were targets of a Marston investigation. What you are then left with is this: An ambitious, but obscure Republican U.S. Attorney is suddenly a household name, wisely perceived to be the victim, unjustly, of the very patronage system that candidate Carter had - expansively, and incautiously - promised to put an end to; the President's integrity has been endlessly called into question; the burden of proof that investigations initiated by a Republican U.S. Attorney, and involving two sitting congressmen, were worth pursuing in the first place now rests heavily with the Carter administration. Who will readily believe, if Mr. Marston's successor does not successfully prosecute these cases, that there was not a "cover-up"?

We do not happen to subscribe to the view of Mr. Marston and his bipartisan supporters in Philadelphia that he had any right to serve out his term. Nor do we think that the President should be severely faulted for not having carried out, to the letter, his promise to make judicial appointments entirely on "merit." Presidents, as we have earlier noted in this space, have traditionally yielded to Congress the right, in effect, to do the nominating in such cases. Mr. Carter has, in fact, gone a long way toward reclaiming presidential prerogatives with respect to the appointment of federal judges, if not U.S. Attorneys. And that is just the point of the Marston affair. Even after the Eilberg intervention, it could have been handled to the profit of the administration - Mr. Marston, for example, could have been allowed to stay on long enough to wind up the Eilberg/Flood investigations that have now become the center of the controversy. Instead, in what can only be put down as a significant display of incompetence, the administration has somehow managed to turn it into a loss.