This is the story of justice gone awry. It is also the story of one man's ordeal. His name is James M. Beggs, once a top executive for General Dynamics, who gave up big business for public sevice. He wound up running the space program for President Reagan. Those who know Jim Beggs describe him as "a straight arrow" and "unbendingly honest."

Yet Beggs was wrongfully indicted by overzealous Justice Department prosecutors. In December 1985 they called two news conferences -- one in Washington, the other in Los Angeles -- to trumpet the accusations. The news was splashed on front pages and television screens. Overnight, Beggs' reputation lay in ruins.

A year and a half later, when an embarrassed Justice Department had to drop the indictment and acknowledge it was all a terrible mistake, the announcement was tacked inconspicuously on a bulletin board in a Los Angeles courthouse.

What went wrong? Sources who have followed the case closely say the Justice Department decided to crack down on the defense industry. Prosecutors selected General Dynamics, the sources say, before deciding exactly what the charges would be. They zeroed in on a contract dispute over development of the DIVAD antiaircraft gun, which eventually was scrapped by the military as a failure.

This got the support of Robert Bonner, the U.S. attorney in Los Angeles with jurisdiction over Pomona where the gun was developed. The Justice Department sent attorney Gary Black to Los Angeles to determine what laws might have been broken.

Black told his superiors at Justice there was only a 50-50 chance of making the charges stick. Justice won't release his findings and he would not talk with us. But shortly after evaluating the case, Black transferred to a different division.

His replacement, Randy Bellows, plunged into "a web of laws and regulations," in the words of the court, "that almost defy understanding." He piled up stacks of papers loaded with technological and accounting data. He enlisted lawyers, investigators and technicians to help analyze the material.

He still got it wrong. Court records suggest he simply did not understand the contract, applicable laws or Pentagon procedures. The contract merely asked for General Dynamics' "best effort" to meet the terms. Under it, the company probably could have delivered a bucket of bolts. But Bellows obtained an indictment against Beggs and three other company officials. The indictment charged they conspired to defraud the government by shifting $7.5 million in cost overruns to other accounts.

Friends say Beggs was devastated. He resigned from the space program and spent two years without income trying to clear his name.

In the end, U.S. District Judge Ferdinand F. Fernandez denounced the government for indicting corporate executives, including Beggs, without really tying them to the alleged conspiracy. Rebuffed, the prosecutors tossed in the towel and asked the judge to dismiss the case.

Under the U.S. legal system, the Justice Department is immune from its mistakes. But the innocent victim lost a year and a half of his life, not to mention his job, income and legal expenses.