ISS's reason to exist went away when the Shuttle was mothballed. The ISS was, in turn, the reason to keep flying the Shuttle. They tried to come up with a similar dodge for SLS, in the moon orbit base, but SpaceX pulled the rug out from under that. That would have been a boondoggle of dven more epic proportions than STS/ISS.
We still need to find a way to shut down the F-35 without needing to cancel all the subcontracts let for parts of it. Without saving those, it will never be allowed to die. (Using the afterburner destroys parts of the rear control surfaces, that have to be replaced at a cost of, what, tens? hundreds? of $thousands after the flight... if it lands.)
This is a popular idea, but it can't really be proven. The decision to have ISS comes from many people and countries, and those people have different reasons - including, among others, employing Shuttle, former Soviet engineers and an accessible space outpost to conduct space experiments.
Who needs government sponsored science? All hail the Musk!
"I said ship it!"
Luckily, no one is responsible if things go wrong!
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.