The most well-known explanation is that given by Rabbi Avraham Eliezer Hirshowitz (quoting Ma'aseh Alfass). He reports that it says "in the Yalkut" on Exodus 16:27 "And behold on the seventh day some of the people went out to gather [manna] and did not find any". Why does it say "and did not find any"? Because Datan and Aviram went out on Friday night outside the camp and spread some manna, in order to make Moshe a liar, since he said there would be no manna on Shabbat. They then said to the people: go out and see that there is manna in the fields! Therefore, some people went out to gather, but found nothing because the birds had eaten the manna which Datan and Aviram had strewn about. We give them their reward on Shabbat Shirah since we also read the story of the manna on that day.
What is the problem with this explanation? Rabbi Glinkin explains:
So says "the Yalkut", but as Rabbi Menahem Mendel Kasher points out, this midrash is not found in Yalkut Shimoni or any other collection of midrash. Indeed, in Sefer Matamim it is quoted in the name of Rabbi Bunim of Parsischa, while in Sefer Ta'amey Haminhagim it is quoted in the name of the Holy Seer of Lublin. Therefore, this midrash is really a hassidic explanation from the nineteenth century.(Sidenote - read this Jewish Ideas Daily article which clearly had not searched for the origin, and reached far reaching conclusions based on this error)
Glinkin offers four other explanations, and then comments that when there are so many different explanations for the origin of a minhag, we can assume the true reason has been lost to history. Wise words, not just in Midrashic scholarship, but for all academic pursuit.
So the question. for me at least, becomes not the origin of the custom, but what is the earliest accounts of the custom we can find? According to this website the custom is attributed to the Mahral (1520-1609), though it does not actually quote him, nor could I find a quote from the Mahral. Otherwise it is easy to find plenty of ahronim (footnote 8) from the 17th century on-wards who mention the minhag (I believe the Magen Avraham is the earliest).
So can anyone find an earlier mention of this minhag?