The project was intended as dual-use from the start, the shuttle was pitched as a way for the USAF to get classified payloads into space and experience for their military personnel.
The shuttle has flown some classified missions for the DoD but not as many as initially intended, because the platform didn't turn out as reliable as they had hoped. [0]
The originally envisioned Space Shuttle was much smaller, but NASA couldn't get funding without USAF. In the process USAF and NRO demanded a much larger shuttle, which required the boosters and the additional orange fuel tank, and generally raised operating costs. You could argue that this significantly contributed to the overall failure of the shuttle program (outside of narrow use cases)
Then came the Challenger Disaster, which grounded the Shuttle fleet for three years and lead NASA to cancel all performance improvements, leading to the NRO giving up on the Shuttle as a launch vehicle. In the end the space shuttle was neither reliable enough nor powerfull enough for NRO missions. [1][2]
The NRO requirements were a huge part of what sunk the shuttle. One requirement was that the Shuttle should be able to launch into a polar orbit, launch a reconnaissance satellite (to replace one that the Soviets shot down), and then immediately land after coming once around (so the Soviets don't also shoot down the Shuttle). This is why the Shuttle has that massive, heavy delta wing--because you have to do a lot more controlled aerodynamic gliding to land from a polar orbit.
Of course, the Soviets never shot down an American reconnaissance satellite and the Shuttle never launched into a polar orbit. Also the military and NRO figured out that you could just launch a reconnaissance satellite even into a polar orbit on an unmanned rocket anyway.
The Soviets, of course, were a lot more inclined towards unmanned solutions anyway, and concluded that the only thing the Shuttle would actually be useful for was orbital bombing, since it could launch nukes, do a burn to change its orbit, and repeat until empty to confound any kind of ASAT system. And then they panicked, invented their own space shuttle, and then collapsed as a major superpower and abandoned the project. I don't know of any clear evidence that the USAF even considered this, but if you evaluate the Shuttle design from a perspective of already having different and arguably better solutions for all of the stated requirements, it was probably safer for the Soviets to think, "this must be a secret orbital space bomber" than to think, "wow, the Americans made a lot of really weird and nonsensical design decisions". Among other things, they probably didn't account for the fact that the American space program held onto the mythos of the heroic astronaut even when manned missions weren't the best technical solution (e.g. satellite launches).
The compromises arising from NRO and other intel/military requirements may very well have "sunk" the Shuttle (or helped do so); if so, it was only after the same compromises likely helped it garner much of the political support necessary to build it in the first place. DOD caused all sorts of headaches, but the alternative probably would have been no launch system rather than a better one. It certainly helped protect the program when it at risk:
> When in 1979 President Jimmy Carter considered canceling the shuttle program because of its cost overruns, it was the national security uses of the shuttle, particularly in terms of launching the photo-reconnaissance satellites needed to verify arms control agreements, that convinced the presi- dent to continue the program. Once the Reagan administration took office in 1981, an early action was to confirm as national policy that the shuttle would be “the primary space launch system for both United States military and civilian government missions" (Logsdon, 291).
Maybe we'd have been better off had that happened, then or earlier. But there's little indication that NASA would have been able to successfully get approval for a less radical vehicle without the Shuttle's biggest selling point at the beginning: cheap, reusable, with a fast turnaround time. And in terms of mission capability, everything and the kitchen sink to boot.
As for the compromises, among other examples, in 1969 the Shuttle's payload bay was "...in fact sized to launch HEXAGON," or Keyhole-9, then in development, ten feet in diameter by 60 feet long and over 30,000 pounds (Logsdon, 167). Well and good, except for the fact that HEXAGON would be EOL when the Shuttle started flying and thus was never expected to be launched on it. But they figured any future satellites would be the same size and weight, so the Shuttle was likely designed around those parameters as a result. Oops.
For what it's worth, even if the national security community hadn't originally pushed for the cross-range single pass capability that helped lead to the delta wing design, it's likely that NASA would have wound up there anyhow:
> The need for high cross-range was throughout the shuttle debate a point of contention between NASA and the national security community. In reality, requirements for national security missions requiring high cross-range were never formalized and more or less evaporated during the 1970s. Well before that time, however, NASA had decided that a shuttle having significant maneuvering capability as it returned from orbit was needed to survive the heat of entry into the atmosphere. So while the national security cross-range requirement initially drove NASA to a particular shuttle orbiter design, one with delta-shaped wings and the thermal protection needed to resist high temperatures during a maneuvering entry, NASA likely would have adopted a similar design even if that requirement had not been levied in 1969. Whether NASA would have gone forward with a shuttle having a 15 × 60 foot payload bay and powerful enough to launch the most heavy national security payloads is not as clear; in the final days of the shuttle debate in December 1971, NASA put forward a somewhat smaller and less powerful shuttle as its proposed design (169).
I cannot recommend John Logsdon's After Apollo? Richard Nixon and the American Space Program[0] enough. It's a fascinating look into the politics and challenges NASA faced even in the heady days after Apollo 11. And, yes, the mistakes: by DOD, NASA, congress, and the White House starting with Nixon.
For those interested, there is a good series of essays on The Space Review detailing the National Reconnaissance Office’s effort to integrate Space Shuttle operations into its spy satellite servicing schedule.
> The project was intended as dual-use from the start, the shuttle was pitched as a way for the USAF to get classified payloads into space and experience for their military personnel.
Not surprising, given that back then, a) patriotism seem to have mattered more, and b) that's how you got funding for ambitious - and thus expensive - projects.
The shuttle has flown some classified missions for the DoD but not as many as initially intended, because the platform didn't turn out as reliable as they had hoped. [0]
[0] https://en.wikipedia.org/wiki/Manned_Spaceflight_Engineer_Pr...