I would have a guess it harks back to the days of porters where they could meet and greet you and assist with luggage if need be.
I'd understood it to be based on the logic that First Class passengers were Important People who, on arriving in London, would expect to be off the train and on their way as soon as possible. Presumably being at the London end, they'd not only be easily met by porters but would also be first in the queue for taxis.
On the way out of London, the First Class passengers would be nearest the buffers so that they didn't have to walk so far to get to their seats.
Of course, in steam days First Class was likely to be in the middle so that it was as far from the locomotive as possible in either direction - and in a train with multiple portions, or reversals
en route, could be absolutely anywhere!