John B. Anderson tried to regain his reputation for standing up for unpopular causes by telling aerospace workers today that the MX missile is bad for the nation.

"I didn't come here just to tweak your noses, or in some kind of strategy of confrontation to tell you I want to take your jobs away," the independent presidential candidate told a crowd at TRW, a conglomerate that has $50 million research contract for the missile. About 500 company employes are involved in it.

But Anderson, standing on a podium in front of the company's huge research complex here, said, "I just happen to believe that it is not the best way to spend $65 billion . . . I think it's destabilizing rather than contributing to the ultimate peace and security of the country.

"I happen to believe that to build 200 miles of roadway to race 92-ton missiles up and down between 4,700 multiple protection centers is going to do one thng: It's going to add 4,700 new targets in the southwestern United States" for Soviet attack.

Anderson departed from a long and uninspiring text about technology and innovations to make his remarks. The immediate reaction was a momentary hush over the crowd of about 1,000 lolling in the midday sun.

But moments later the crowd broke into applause when Anderson said he wanted to use the money that would be spent on the MX for basic research and for the space program.

"We're going to keep this industry. We're going to keep the space industry and the high technology industry you represent on the cutting edge of progress," he declared. "We're going to keep you alive and healthy in a way I think is compatible not only with national security but with equally broad economic goals of this country."

Anderson has long opposed the MX missile program which his major party opponents, President Carter and Ronald Reagan, support. But previously he has confined his words on the subject to sympathetic college audiences.

His choice of setting for today's remarks, in the heart of California's military-industrial complex, was reminiscent of the tactic he used to first gain national attention last winter. The most publicized such event was a speech he gave advocating strong handgun control laws before a group of New Hampshire gun owners.

Some Anderson advisers have argued that the candidate should return to that same form as criticism has mounted over the congressman becoming "just another politician" with few new ideas.

Anderson began trying to counter that criticism early this week, each day passing out a portion of his 317-page platform on a given issue. On Sunday, the issue was his program for rebuilding cities. On Monday his plans for increasing higher education spending, on Tuesday his mass transportation program and today his program for dealing with toxic wastes.

The effort, however, attracted almost no attention. And Anderson seemed almost sheepish about it.

His remarks today had all the earmarks of a political grandstand play. But traveling press secretary Tom Mathews insisted they had not been planned. "You can't program John Anderson," he said. "He's too stubborn and unpredictable."

Rather then the MX, Anderson said he favored a "better and cheaper" alternative -- the use of a submarine-based missile force which he claimed would cost only about a third as much as the land-based program.

During his remarks, the independent candidate, who is on a four-day campaign swing through California, launched stiff attacks on both Reagan and Carter.

He praised the League of Women Voters for inviting him to participate in its Sept. 21 debate in Baltimore, and castigated Carter for declining the invitation. "Thank goodness we've got an independent organization that says, 'Mr. President, we're going to have this debate with or without you and if you don't show up your chair will be empty but the debate will go on.'"

As for Reagan, Anderson said he had just finished reading the economic speech that the former California governor had given earlier this week and he still is unable to understand how Reagan intends to cut taxes, increase military spending and balance the federal budget all at the same time.

This suburban Los Angeles area should be Reagan country. But the crowd seemed receptive to Anderson.

"I was very curious to see what kind of approach Anderson would make. You have people here who are intellectual and brainy.They are a mixture of technical people and scientists, who care about the country," Relda Spraul, the wife of a chemist, said. "But these people are the type who like some gutsiness in a politician."