Seven years ago, Boeing Co. lost a bruising battle with environmentalists over the supersonic transport jet.

Today, the same environmental concerns that killed the company's pet project are bringing it millions of dollars worth of business.

"Our company loves to respond to a national need," says Garry L. Quinn, director of Boeing's engineering and construction division. "Not necessarily because we're patriotic. We've found you can do well by doing good."

In the past few years, Boeing has gotten into the garbage recycling business, built noise mufflers for power plant, and designed a floating facility to desalt water for the Arabs. Using technology developed for human wastes on spacecraft, it has even come up with a slude-drying process for sewage plants.

And Boeing is not alone. Indeed, while much of corporate America vigorously fights enviromental regulation, a growing number of companies have dicovered that pollution can mean profits.

More than 600 companies - including some notorious polluters - are cashing in on the environmental movement. From individual entrepreneurs to billion-dollar corporations, they are manufacturing a dazzling array of pollution control diveces, as well as providing engineering, construction and other services.

"Federal legislation spawned a brand new industry," says Kenneth Leung of Smith. Barney, Harris, Upham & Co., one of a dozen Wall Street specialists on enviromental companies. "This is definitely a growth industry. It has an extremely bright future."

According to the Council on Enviromental quality, $40.6 billion was spent for pollution control last year - 50 percent by industry, 30 percent by government and 20 percent directly by consumers.

The Commerce Department estimates that anti-pollution spending increased 86 percent from 1972 to 1976 - an average of 17 percent a year, compared to 10 percent for the gross national product.

And, while industry claims that environmental laws cost jobs, it appears they may create more than the destroy. Environmental Protection Agency fugures show 20,318 jobs affected by plant closure since 1971. A 1974 National Academy of Sciences studyfound 677,900 persons employed in the pollution control industry - a figure that has reportedly increased since then.

"We're a baby of the environmental movement - a war baby," says Ira Kukin, an immigrant carpenter's son who became a millionaire thanks to pollution laws.

Kukin, a researc chemist, started a small company 15 years ago to make gasoline additives. But with the rise of environmentalism, "we saw a great opportunity," he recalls. With several researchers, he developed a chemical process to collect the dust from power plant smokestacks.

Now the company, Apollo Chemical Corp. in Whippany, N.J., has grown from 10 to 400 employes. Annual sales, now $30 million, have increased 50 percent a year over the last decade. Kukin has office in England, Italy, Spain, Germany, Israel and Iran.

If the federal governmental weren't forcing utilities to clean up air pollution, Kukin says, "our sales would be 1-or-2 million dollars a year.Everything we do is because someone has a gun to someone's head."

Big companies are also getting into the business. Corning Glass Works, for example, employs 350 people in a new converters. Union Carbide makes treatment systems for city sewage plants.

Some corporations, forced to clean up their own pollution, found they can market their new expertise. Exxon and Shell make chemicals to clean up oil spills. The Dupont Co. sells air pollution devices to 70 textile and nitric acid plants. General Motors peddles its catalytic converters to American Motors.

"Get the waste out without wasting money," advises the FMC Corp. in a recent magazine ad for its Environmental Equipment division. Thus, the same company which was charged by the Justice Department last year with spilling a dangerous chemical, carbon tetrachloride, into the Ohio River, is able to boast about its equipment to clean up steel mill waste water and coal plant smokestacks.

Given an ever-expanding market, the environmental industry has experienced cutthroat competition. Newcomers bid low to attract their first contracts, thus forcing down prices industry-wide. However Leung predicts that profits - now about average for American industry - will pick up "as utilities and cities realize that you get what you pay for."

Robert J. Wright, vice president of Zurn Industries, an air pollution equipment maker, say. "All the publicity about the environment has attracted companies looking for diversification. But when they get into it they find a pretty closed club. They can lose their shirt."

One aerospace company, TRW Inc., went into the electrostatic precipitator (smokestock cleaner) business, but had to cut back operations when its only American unit, on a Kaiser steel plant, was shut down with corrosion problems. Industry sources estimate TRW has lost $10 million to 20 million, but company officials say they still hope to market the design.

Rivarly between bidders on a recent contract to supply hardware for a federal water desalinization plant in Yuma, Ariz., was so intense that one of the losers, Dupont, took the Interior Department to court.

However, the competition is balanced by the rewards. Sales in Boeing's environment and energy division grew from $30 million in 1976 to $58 million in 1977, with over $100 million expected this year. Environmental products accounts for about 30 percent.

Zurn Industries, which started as a foundry in 1901, has experienced "dramatic growth" in the last few years, Wright said. Without environmental laws, "we'd be selling $40 million worth of goods a year instead of $135 million," he added.

The growing environmental industry has spawned a flurry of trade associations. Unlike traditional industry groups such as the American Petroleum Institute or the Edison Electric Institute, some are lobbying in favor of environmental regulations.

The National Utility Contractor Association, for example, testified in favor of a strong water pollution bill. The association's 2,000 construction firms have much to gain from the Epa's $45 billion municipal sewage program - the largest public works outlay since the Highway Trust Fund opened shop.

Zurn Industries' Wright is president of the Industrial Gas Cleaning Institute. "IGCI: Then Clean Air People," his business card reads.

"We're members of the National Association of Manufacturers but we have battle royals with those guys," Wright said. When American Electric Power Co. ran ads against tough clean air laws a few years ago, claiming that smokestack scrubbers don't work, IGCI countered with slide shows for congressional staggers asserting the opposite.

However, environmental industry lobbying tends to be low key - and for a good rason. "We don't always want to come out and say environmental protection is good for you." Quinn said "Boeing hesitated before joining the Environmental Industry Council because our customers have problems with regulation. It costs them money."

CEQ predicts industry will spend $289 billion on pollution control in the next eight years. While companies who have to spend it may view it as money down the drain, much of it will go into the pockets of a new industry, thus belying the popular image of a strong economy and environmentalprotection as two irreconciliable goals.