THE D.C. SPECULATION TAX didn't work. Only six people have paid it since the tax was enacted in July 1978. In the District, where real estate investments are a major inflation hedge, thousands should have paid the tax. But big speculators are able either to ignore the law or to take advantage of it because the law is so badly written.

Meanwhile, more speculators are being drawn to the city by a tight housing market. Population reports indicate that well-off young people are coming to the city in great numbers. They need housing and are ready to pay high prices for it. In addition, downtown office buildings continue to sprout at an amazing rate by any standard you care to mention, changing once-depressed neighborhoods near downtown into high-rent districts and uprooting longtime residents.

In the face of this real estate fury, the city government says there is little it can do to shape or limit change. The speculation tax was intended to be a lever of control; it was designed to discourage real-estate dealers from speculating too freely (but not to stop speculation and housing rehabilitation) by taxing investment properties bought and sold within a three-year period. The speculation tax is based on a sliding rate schedule. No tax is imposed on the seller if there is less than 11 percent profit on the sale of the house. But if there is, for example, a 300 percent profit within the first six months after the property was purchased, a 97 percent tax is imposed on the profit.

According to one of the bill's authors, the tax, though generally a failure, cannot be tototally measured by the number of people who have paid it, for it has had some success in scaring small speculators out of the District. But, he says, the law needs major revision now if the city government is truly interested in limiting speculation.

Mayor Marion Barry has recognized the failure of the tax to curb or control speculation. At his request, a task force was formed to review the law and make recommendations for improving its enforcement. In August, the task force reported that the basic law needed to be reworked. It said one possibility is to require that the speculation tax be paid by the seller of a property before the buyer is allowed to register his deed. A second is that the finance and revenue department be empowered to pursue the seller of the house for payment of the speculation tax once the new deed is recorded. The task force said there are also problems with the warranty provision of the law.

The mayor has decided to wait until January to send some of the task force's proposals to the city council for action. Meanwhile, responsibility for collecting the tax has been shifted from the finance and revenue department to the maps and titles department, and wages for four persons to pursue the non-tax-paying speculators were included in the city's 1981 budget. But better enforcement of the law cannot overcome the effects of its having been so poorly drafted. It now allows speculators to offer short-term warranties on houses that have not been inspected for structural problems, so speculators gamble that the houses won't need repairs during their warranty period. There are also problems with the law's applicability to condominiums.

Such defects make the law next to useless despite changes in the enforcement procedure. As one of the city's few tools for controlling speculation, the law should not have been allowed to remain useless for so long. The mayor should send the bill to the council as soon as possible, and the council should make it a priority item.