The NASA inspector general is investigating whether space shuttle contractor Morton Thiokol Inc. improperly punished two of its engineers who argued, the night before its disastrous Jan. 28 flight, against launching Challenger, agency officials said yesterday.

The disclosure of the probe came as 27 senators signed a letter calling on the National Aeronautics and Space Administration to "reevaluate" its relationship with Thiokol, maker of the shuttle's solid rocket boosters, if the charges of retaliation against the engineers, Allan J. McDonald and Roger Boisjoly, are substantiated.

"This is an outrage of the first order of magnitude," said Sen. Albert Gore Jr. (D-Tenn.) of the treatment of the engineers. "It is incomprehensible to me that Thiokol could watch the courage and candor of those two engineers and then turn around and punish them."

NASA officials said yesterday they are questioning whether to continue the civilian-in-space program, which placed teacher Christa McAuliffe on board the Challenger for its Jan. 28 flight.

In testimony that the chairman of the presidential commission on the accident has called "shocking," McDonald and Boisjoly told the panel May 2 that they were stripped of their responsibilities and given less important jobs after they first testified in February about their protests against the launch.

The testimony, contained in more than 300 pages of transcripts released Saturday, raised questions about whether witnesses before the commission were being subjected to retaliation. Deputy NASA Administrator William R. Graham said yesterday he ordered the inspector general's probe in part because top Thiokol officials, including chairman Charles Locke, may have violated assurances they gave him in February that employes would be allowed to testify without being influenced or afraid of retribution.

"I am concerned that either the appearance or possibly the substance of such influence might exist," said Graham, who stepped aside as acting administrator on Monday when James C. Fletcher was sworn in as administrator.

Thiokol spokesman Tom Russell yesterday said McDonald and Boisjoly were reassigned after their initial testimony before the commission, but he denied that they were punished for what they said. McDonald, who had served as manager of Thiokol's solid rocket booster program, had said he was reassigned to what he called a "more menial" job as director of "special projects" with no staff -- a transfer he charged was punishment.

Russell said the change was made only because, with the grounding of the shuttle, the company is no longer producing solid rocket boosters. As a result, he said, McDonald and Boisjoly are working on the redesign and testing of new booster joints and other tasks.

"Yes, responsibilities have changed, but the program is vastly different," Russell said. "They have not been demoted. They have not been punished at all. . . . We take exception to what Commission Chairman William P. Rogers has said."

Graham's comments came during a House Appropriations subcommittee hearing at which Fletcher disclosed that he has asked former Apollo project director Sam Phillips to conduct an in-depth study of NASA management in an effort to correct problems identified in the Challenger probe.

Agency officials also said they expect to resume shuttle flights in July, 1987. And they said they are reexamining the civilian-in-space program in light of the heavy backlog of scientific and military missions created by the grounding of the shuttle.

Richard Truly, associate administrator for space flight, said that, while he has supported the civilian-in-space program, he is concerned that as a "practical" matter it may not be able to continue, given the heavy space flight demands that would require professional astronauts and trained scientists.

"I do think it's an issue that needs a relook," Truly said.

The investigation by NASA inspector general William Colvin will consider whether Thiokol has violated federal regulations or guidelines for government contractors and whether the firm breached assurances company officials made to Graham on Feb. 21, according to Graham and an official in the inspector general's office.

On that day, a week after McDonald first testified before the commission in executive session, Graham said he met with three senior Thiokol officials, including company chairman Locke. He said he told them it was "an extremely important principle" that company employes be allowed to testify "without influence" before the panel. He said the three officials assured him they would comply and would alert the commission or Graham to any attempt to influence testimony.

Four days later, McDonald was the star witness at a public hearing before the commission. In a calm and unemotional voice, he told how during a five-hour teleconference on the evening of Jan. 27, he and Boisjoly argued repeatedly with NASA officials against launching the Challenger the next morning, because of their concern about the impact of cold weather on the O-rings that are supposed to seal the rocket booster's joints.

As part of the investigation, Graham said, the inspector general also will look into whether NASA officials played a role in the transfers of the two engineers. This is an apparent reference to McDonald's testimony that he later had a confrontation Lawrence Mulloy, the former manager of the agency's solid rocket booster program, who had argued in favor of the launch.

According to McDonald, after his public testimony, Mulloy "came into my office and slammed the door. . . and was very intimidating to me. He was obviously very disturbed and wanted to know what my motivation was. . . Mulloy said you're giving information to the commission without going through your own management, without going through NASA."

Mulloy denied that he slammed the door and said he was only trying to ask McDonald why he hadn't expressed his concerns about launching the Challenger earlier.