Alex, I was reading something about this recently. I have been trying to locate what it was that I was reading, and have not been able to, and my memory is sketchy. Basically, it had to do with the pre-electricity history of signaling, as GN Man points out, and it has to do with a fail-safe default.
Before lights, there were semaphore arms, and the first semaphores were configured so that the horizontal arm meant stop, and then the arm dropped down for go. ("Lower quadrant" semaphores.) The problem with this set-up was that if the semaphore malfunctioned (broken control rod or cable), the default due to gravity would be that the arm fell, giving the go-ahead signal. Obviously, this was not good.
So by 1900 semaphores were changed to be horizontal for stop, then the arm was pulled up for the go signal ("Upper quadrant" semaphores.) The default position should something malfunction and the arm dropped, would now be "stop".
When electricity was added to these semaphores, the green lens ended up being on top, like this:
and as emulated by this Ives semaphore from 1923:
So then, when signals went to being just lights, the same arrangement with green on top was continued.
I think that's the gist of what I read, I'll keep trying to find it.
Of course, we've all also seen semaphores that use upper quadrant signaling but have the red lens on top, depending on how the semaphore is constructed and how the arm pivots. So I'm not sure how water-tight this theory is. But I do think it has to do with pre-elecricity signaling, and the convention then carrying over into the electric light signal era.