Ugh. Space Shuttle was proposed at the height of Cold War - way before Apollo-Soyuz joint flight - with ideas from military as well as from bean counters. After Challenger disaster US military started to come back to conventional launchers, like Titan-IV - and Gorbachev was already in the office, and USSR crashed in early 1990-s - so you're mostly right that Space Shuttle didn't have much to do for military or for making access to space less expensive.
On the other hand, STS did flew separate missions, including Hubble servicing ones. And maybe it could be repurposed for something else - there are many examples how older space systems are trained for new tricks. In case of Shuttle that could be trickier, since crew safety is at stake, but still - both Apollo and Soyuz flew successful program, and both this spacecrafts killed their earlier crew. As for automating tasks, Shuttle is way less automated than most small satellites these days, per unit of functionality - after all, Space Shuttle was designed starting in late 1960-s.
I personally think it's correct decision to retire STS, and it should have been done earlier - given that after Challenger STS didn't switch to "few person, safety abort systems for all moments in flight" vehicles. US space industry had to survive 1990-s, where not too much of results happened in the area of safe human flights, so yes, it was hard to ground shuttles earlier. Still it would be the right decision.