The ability to elevate one's narrow and selfish interests to high moral principle is an envied political art. That is exactly what ex-Democrat and ex-Rep. Phil Gramm of Texas, a most accomplished performer in the political theater, did this week. Gramm deserves credit for dominating the dialogue in the mini-debate over his switch.

Gramm effectively kept the focus off his principal offense, which, according to Rep. Wyche Fowler (D- Ga.) was not "standing up for his convictions," but "open and blatant collaboration with the White House" on the 1981 budget and tax bills. Gramm's double-agent role was first revealed by budget director David Stockman in that now-famous Atlantic Monthly piece by William Greider. According to fellow "boll weevils," Gramm, who had pledged to support the budget produced by the Democratic House Budget Committee, reported regularly and fully to Stockman and the White House on the Democrats' secret strategy deliberations. Yet in the coverage of his conversion to Republicanism, Gramm has manged to appear as martyr rather than turncoat.

What he has not done is follow the path of now ex- Rep. Gene Atkinson of Pennsylvania, whose formal conversion to the GOP took place in the White House Rose Garden. Gramm chose to make his stand against "the party bosses" rather than rush to the Reagan White House, there to offer his sword and soul. The Gallup and Harris numbers have changed in two years. Party bosses are more reliably unpopular than President Reagan is popular.

Gramm leaves without the good will of several boll weevils; he had told them after the November elections that he would not leave the party unless the caucus were to bounce him from the Energy Committee as well as Budget. Boll weevils who had lobbied their colleagues to let Gramm keep his Energy Committee seat were angry this week to learn that the Texan had at the same time been negotiating the terms of his surrender with White House political pro Lee Atwater. Oklahoma Democratic Rep. Mike Synar put it bluntly: "Phil was a snitch. He could not be trusted."

In any political campaign, there are two finite resources: time and money. What Phil Gramm, armed with plenty of money and a martyr's look, did not need was a long campaign in which either asset might be dangerously diminished. Thus the need to make the move before lame-duck GOP Texas Gov. William Clements leaves office Jan. 18. Clements obliged by setting the election for Feb. 12, leaving Gramm the prohibitive favorite.

But Phil Gramm's effectiveness in the House will not be what it was two years ago. There is respect for his competence, but not for his character. As Wyche Fowler put it: "Gramm's conversion could raise the intellectual and integrity levels of both parties."