What is the etymology of 右に出る, as in 「右に出る者はいない」? What on earth makes the right superior to the left?
Relatedly, is 左に出る ever used to mean "inferior to"?
About the etymology:
A more old-fashioned way of saying "右に出る者はいない" is the proverb "その右に出(い)ずる者なし". The source of this proverb seems to be from「史記 (an old Chinese history book: wikipedia)」(source:a proverb dictionary, source:chiebukuro).
Google found me a Chinese article about the idiom 無出其右 that cites an anecdote from 史記 as its origin. How is that relevant? In fact, in Japanese, "無出其右" is literally read as 其の右に出づる無し.
↓ 無出其右 (Chinese proverb)
↓ 其の右に出づる無し (Chinese proverb read the Japanese way)
↓ その右に出(い)ずる者なし (archaic Japanese)
↓ 右に出る者はいない (modern Japanese)
If someone can read and explain the story in the article, that could be the root of the etymology. (It's not definite because the anecdote can be fictitious.)
Root of the idiom:
As most people have said in other answers, in Chinese history, when a group of people is gathered, they are placed in order of importance from right to left. Right being the highest position.
Now, the idiom 無出其右 (origin of 右に出る者はいない) has its roots in an old Chinese story.
During the Eastern Han dynasty, 班固 (Bān Gù), the great historian, was summoned to the imperial court along with 10 other officials (including Xian ZhaoChen, Tian Shu and Meng Shu) to debate important matters. Bān Gù being highly knowledgeable and skilled at debate, none of the 10 other persons could stand on his right.
Translation and additional notes from the original sentence “贤赵臣田叔、孟舒等十人，召见与语，汉廷臣无能出其右者。" (无能出其右者 being the classical Chinese origin of 無出其右 and its Japanese version 右に出る者はいない)
I don't know Chinese histroy but my Japanese dictionary says that during Han Dynastry at China, they defined the system that right side of the place (eg., for seat) is for higher rank. And Japanese just follow it.
It's related to the Han dynasty. A quick search on Japanese sites give the following explanations:
"It was customary at that time to order the people by rank, starting from right to left (and putting the emperor in front). When you messed up something, you were to be seated at a place more on the left than before. This is what is called sasen."
(Sasen, 左遷 is therefore the "asymmetrical" opposite.)
"When writing down the names of the official ranks, names were written from right to left. 右に出るものはいない then means that there is no one above this person."
According to this page, there are a few possibilities.
The answer that received the highest votes says that In China and other south Asian countries, and in Bhuddist and Islamic cultures, the left hand is the one you use to wipe yourself with after using the bathroom, and so the left is associated with dirtiness.
It also goes on to say that dioramas with dolls of the imperial family order the members of the imperial house from left to right, where right is the higher status. (This would be inline with the answer given here, where people actually standing in front of the emperor are lined up similarly with higher ranking people to the right.)
The answer goes on to say things about how in Europe and generally across cultures, there is a bias against left handedness, which I would agree with. In English, the word "sinister" comes from Latin roots associated with the word for left. In Chinese the word for left is associated with "out of accord", at least, according to Wikipedia.
Other, less plausible (in my opinion) answers offered on that page are:
In images of the goddess Izanami, who gave birth to Japan, the sun, the moon, and storms, the order of which gods are oriented around her, and associations with those gods gave rise to preferences and associations with left and right. (The explanation on the page was unclear to me as to why one god would be better than another, though. The sun god is on the left, the moon god on the right, but I would have assumed the sun god would be higher status...)
In the Japanese vertical writing system, columns start from the right and work their way left, so if you were making a list of important points, the more important ones would be in the columns to the right.
In the end, I personally think the generalist answer is the most accurate: Right and left handedness are percieved across cultures as superior and inferior, and it's the phrase that follows that bias, not the other way around.
So it might be the case that the specific phrase you're asking about comes from the ordering of imperial household members, either in person or with dolls, but the reason they ordered them that way was because of a fundamental bias against left-handedness that originated from way back in China and South Asia and across cultures.