ATTACKING government regulation is one of Ronald Reagan's favorite campaign themes. So his decision to criticize automobile regulation in Detroit, just before last week's primary, came as no surprise. But the Michigan results suggest that this time the facts spoke loudly, and his strategy backfired.

Mr. Reagan charged the Carter administration with "conducting a concerted campaign to cripple the American automobile industry" by "regulating it to death." The regulations, said Mr. Reagan, generally require investment that "makes American auto makers less competitive with foreign imports." When it was pointed out to him that foreign cars sold here must meet exactly the same standards as American cars, Mr. Reagan simply ignored it and proposed "an immediate moratorium" on new regulations until the costs can be considered. But the costs -- and more important, the benefits -- are already clear. Each type of regulation -- mileage, emissions and safety -- has proved its worth.

Mileage standards, enacted in 1975, require a doubling of average fuel efficiency by 1985. Auto executives have frankly admitted that these standards, by forcing Detroit to move more quickly toward fuel-efficient cars, spared the industry an even worse disaster than what it is now experiencing. Cost calculations show that the additional cost of a 1985 car due to the standards will be much less than the cost of the gasoline that would otherwise have to have been bought. And those calculations do not include the national benefits of a reduced need for imported oil.

Mr. Reagan charges that it was the abrupt consumer response to last year's "government-caused shortages" (i.e., gas lines) that caused Detroit's problems. "If the change had been more gradual," he argues, "American producers would have been able to adjust." But in the preceding six years of gradual change since oil prices quadrupled in 1973, American auto makers determinedly ignored the already obvious need for more efficient cars. And Mr. Reagan disregards Detroit's continuing resistance to higher mileage standards.

A Senate committee has valued the benefits attributable to automobile emissions control at between $2.5 billion and $10 billion a year in 1974 dollars. This is an underestimate since it does not measure the additional degradation in air quality that would have occurred had the Clean Air Act not been passed.

The dollar benefits of safety regulation are harder to calculate, since that requires assigning a numerical value to each life saved. It is clear, though, that safety regulations have reduced the toll of death and serious injury from automobile accidents between 15 percent and 30 percent -- many thousands of lives a year.

In brief, it is not so surprising that the people of Michigan -- who know a thing or two about the auto industry -- administered such a severe trouncing to Mr. Reagan.