When delays in testing new hydrogen engines and building new heat-resistant tiles threatened to postpone the first flight of the space shuttle two years ago, the National Aeronautics and Space Agency got money from an unexpected source to keep it on track.

Lo and behold, the Pentagon weighed in with the almost $1 billion in supplemental funds that NASA needed, or 10 percent of Columbia's total cost of $9.9 billion.

Saying there is no love lost between the two is like saying there is no love lost between Carol Burnett and the National Enquirer; NASA and the Defense Department have fought over control of the space program almost from the beginning.

Nevertheless, there was the Pentagon pleading NASA's case before Jimmy Carter in the Oval Office.

The Pentagon's turnabout spotlights its need for the civilian space shuttle, the DC9-sized spaceship that takes off like a rocket, carries as much as 65,000 pounds of cargo into earth orbit and flies home like an airplane with as much as 32,000 pounds of cargo in its payload bay.

With supersecret satellites booked on 11 space shuttle flights the next four years, the Pentagon was not about to suffer a delay because of a simple thing like a shortage of money.

Yesterday, President Reagan demonstrated his appreciation of the space shuttle when he awarded John Young and Robert Crippen, the shuttle astronauts, the NASA Distinguished Service Medal and Young the Congressional Space Medal of Honor, commemorating his five space flights.

About 40 other astronauts, including Neil Armstrong, the first man on the moon, and Sen. John Glenn, the first American to orbit the earth, were at the White House luncheon and award ceremony.

"The farthest star is within our reach," Reagan said. "The shuttle is the world's first true transportation system . . . bringing energy and excitement to our national reserve."

Part of that reserve is national defense and the Defense Department is banking its future in space on the shuttle. At a cost of $200 million, it is building its own spaceport for the shuttle to take off and land at Vandenberg Air Force Base near Santa Barbara, Calif.

It will operate in a new military space center at Peterson Air Force Base in Colorado Springs, alongside the North American Aerospace Defense Command's underground headquarters under Cheyenne Mountain.

The Air Force will have its version of the Mission Control Center in Houston and will train its payload specialists to deploy and retrieve its satellites in orbit.

The Columbia is at least in part a product of Pentagon thinking. The Pentagon insisted its cargo bay carry no less than 65,000 pounds and that it have maneuverability and enough range to be able to take off from Cape Canaveral and land at Vandenberg, more than 1,000 miles off the course it would take if it flew a straight orbital track.

"This was purely a safety consideration," one Pentagon space aide said. "If a malfunction occurs in a certain phase of the flight, we want the shuttle to be able to fly to Vandenberg."

There were security reasons, too. The Pentagon does not want to see a shuttle crowded with secret satellites forced to land in hostile territory because it cannot glide 1,200 miles to the north or south.

The first flight of the space shuttle to carry Pentagon baggage is scheduled for sometime in 1983. Like all 11 shceduled Pentagon flights, it will carry no civilian or space agency cargo. All 11 flights are "dedicated," or devoted exclusively, to the Pentagon for security reasons."

The first Pentagon flight in 1983 illustrates why it wanted the shuttle to go off on time last month. The 1983 flight will carry a supersecret Pentagon spy satellite so big it dwarfs all previous satellites.

It is so big it would have cost as much as $150 million to put it into space on a conventional rocket, if one could be built to carry it. It is so big that the shuttle's hydrogen engines will have to be throttled up to 109 percent of their normal operating capacity lift it into orbit.

"That flight was dedicated for 1983 for national security reasons," one Pentagon source confirmed. "It is needed to verify the next step in the SALT treaty."

Despite charges by the Soviet Union that it will be a spaceborne war machine, the shuttle will not carry weapons, at least in the foreseeable future. First, a laser weapon needed in a space battle is too big for the shuttle right now; the power supply alone would be too heavy for the shuttle to lift.

The shuttle does not need weapons to be a useful military tool, however. Even before it carries the heavy spy satellite into orbit in 1983, the shuttle will truck an experimental military laser and an infrared navigating device to guide shuttle pilots to orbiting satellites to repair or retrieve them.

Such a device also could guide future shuttle pilots to hostile satellites which they might either put out of business by cutting their radio antennas with a specially designed space tool or gather them into the shuttle's cargo bay to take back to the United States for inspection.

Sometime in 1983, the shuttle will also carry a Pentagon infrared sensor code-named Teal Ruby, which is being built to pick up exhaust heat of missiles going into orbit, of jet aircraft at high altitudes and even of secret enemy space satellites whose radios are turned off to keep them hidden in space.

Later, the shuttle will carry a Pentagon aiming device code-named Talon Gold that could be used by a spaceborne laser weapon.

Nothing illustrates the usefulness of the shuttle to the Pentagon like the six Navstar satellites it will carry into orbit for the Navy in 1985, 1986 and 1987. To be put into a 12,000-mile-high orbit where they will join 12 identical satellites now being put into orbit, the Navstars will be strung out like beads around the earth to provide the most precise and instant navigational service the Navy has yet devised.

The Navstar network will be so accurate that a ship, plane or even a foot soldier will be able to ask Navstar where they are and get a fix in less than 15 seconds that is no more than 48 feet off in all three dimensions: north-south, east-west and altitude.

Navstar will tell a jet fighter moving at 1,500 miles an hour toward a target within one-fifth of a mile an hour how fast it is going. It will tell an aircraft moving blindly toward a refueling tanker in the dark down to one ten-millionth of a second when it can expect to encounter the tanker.

As important as the shuttle will be in hauling the Pentagon's space traffic, possibly its greatest military importance will be psychological.

Until the shuttle, military satellites went into space unmanned and fair game for hostile satellites to attack. No longer. In subtle fashion, that unwritten rule of space warfare has been changed.

"If an unmanned satellite is attacked in space, it might become a serious international incident," one Pentagon source said. "Take a serious step like attacking the shuttle and you run the risk of starting World War III."