There are several theories to explain this. According to one of the more colourful, since a cavalryman's sword hangs on his left side, he must mount his horse from the left to avoid getting his feet tangled.
The first pilots often came from the ranks of cavalry officers and it was natural for them to board their aircraft from the left side.
In those days aircraft were all single seaters and the convention of pilot-on-the-left persisted even after the co-pilot's seat was added.
It's not only pilots who board from the left. Most cyclists will hop on their bike from that side, and so do most motorcyclists.
Another theory – the maritime tradition requires ships to pass one another on the left.
To avoid collisions with oncoming aircraft pilots simply adopted this tradition, and for the pilot to gauge the necessary clearance, it was required that they sit on the left, closest to the oncoming aircraft.
In a helicopter the pilot usually sits on the right, although that has to do with the placement of the controls and instruments, not horses and swords.