On a private email list which must not be named, someone asked
"Is there any authentic basis to the legend that the Beis Hamikdash was built
where two brothers secretly brought part of their harvest to each other in the
belief that the other needed it more than him?"
The answer is that it seems to be just what I wrote above. In short, the first appearance of this story in Western literature seems to be Alphonse de Lamartine's travelogue from the 1840s. The first appearance in Jewish literature is in Louis Ginzberg's Legends of the Jews. The first appearance in yeshiva or Bais Yaakov? Who can say. But it's a nice story, isn't it? Sort of reminds me of the Romantic poem Abou Ben Adhem (a historical figure) by Leigh Hunt.
See this article from 1994 by Eliezer Segal and this post by Menachem Mendel from last year, as well as the Ha-Safran archives where this topic popped up two weeks ago.