EVER SINCE he took office as secretary of the interior, James Watt had been trying to open legally designated wilderness areas to oil and gas drilling. But now, having lost a series of battles in Congress, he declares that he is abandoning that attempt. As a practical matter, he had little choice. But if it means that he is going to stop wasting his time and his department's resources on a campaign that has become as futile as it was wrongheaded, his announcement is welcome.

There is a tendency among some of the oil and gas operators, suspicious by nature, to assume that whenever any piece of land is placed off limits it must therefore conceal wealth beyond reckoning. Mr. Watt faithfully represents the wildcat operator's view of the world--and, if anything, overrepresents it. He entered office committed to the idea of carrying out an "inventory" of the minerals in the protected areas, and that has been his justification of his efforts to issue drilling leases.

An inventory is a nice idea, but unfortunately it has no relation to reality. Congress understands that perfectly. Finding oil is not like counting bars of soap on a store's shelf. It is a high art and science. Where one exploratory well finds nothing, another nearby may strike huge reserves. The history of the oil industry is full of cases of great discoveries in areas that, people thought, had already been explored. One oil rig would only lead to another, for an inventory is never complete.

The most interesting aspect of Mr. Watt's retreat from the wilderness has been the demonstration that Congress, which originally established the wilderness system, is prepared to defend it. While the election of Mr. Reagan signaled a change of the national mind on many important subjects, environmental protection was clearly not one of them.

It is also true that the environmental movement in this country owes much to Mr. Watt. With his brash and aggressive manner, he has given the protectors of the wilderness a splendid target. He has made work much easier for the environmental lobbying organizations, and especially for their fund- raisers. When he eventually leaves the Interior Department, there are many among his adversaries who will see him go with mixed emotions. It can truly be said that, unintentionally but nonetheless effectively, Mr. Watt will leave the wilderness system stronger, and more strongly defended, than any of his predecessors ever managed to do.