Why not?
Two thirds of the line generates not much more than a quarter of the passenger traffic.
According to the last Origin Destination Matrix,
Stranraer and
Girvan are both dominated by trains to Ayr and Glasgow. Very few people make journeys between Girvan and Stranraer, with almost all journeys involving Ayr or stations north of there, which means entries and exits are largely proportional to trafic that would be shed if the line is truncated.
The fare increment for heading south of Girvan to Stranraer is only £7.70 from Ayr and £3.40 from Glasgow.
It's a lot of track to maintain for a small flow that isn't even particularly renumerative.
Axing the line south of Girvan, electrifying the stub and fully integrating it into the suburban Glasgow timetable would reduce operaitng costs on the line and likely result in the same or more revenue.