Funnily enough, Christopher Perkins goes into exactly this topic during his 'Storytime'1 speech at PAX South 2017.
Summary: Being exhausted and angry about broken air conditioning at WOTC led to them making up a list of silly liquids for the Alchemy Jug. Mayonnaise eventually was the only survivor of said list (while many others were too inappropriate to keep) because they wanted to eventually hear the hilarious stories of how covering someone in mayonnaise achieved a goal.
Transcript from the speech, to the best of my abilities:
How many of you are familiar with a magic item called the alchemy jug?
[He goes on to describe its appearance and properties.]
Now Jeremy Crawford, who is one of the creators and architects of 5th Edition, I was working with him in the summer of 2014 at work and the air conditioner at WOTC was broken, and we were there over the weekend in 95 degree weather.
Jeremy had just come off the Player's Handbook and I had just come off of the Monster Manual, and we were frantically trying to piece together [the Dungeon Master's Guide]. We got to the Alchemy Jug and we were both so exhausted and we were both so infuriated by the heat that we started to put in stupid ideas for what the alchemy jug could possibly spit out.
Many of them couldn't see print, but the one that we left in was mayonnaise.
The reason- the actual reason- is because Jeremy and I knew that the next time we'd go to a convention- or conventions for the rest of our life- somebody was going to walk up to us and tell us the story about how their barbarian covered themselves in mayonnaise to get out of some stupid situation that the DM created or to slip out of the grasp of a monster, or god knows what- like, all kinds of filthy things started to run through our minds at that point, and we thought "Yes! Yes, mayonnaise!", because- as stupid as it is, I don't know if there's mayonnaise in the D&D world, but as stupid as it is, it is going to create so many good stories, that it is totally worth it. It is worth the absurdity, in an official core rulebook, for the sake of the story.
But also, honestly, like you, we're just 13 years old at heart.
1: In case VOD link does not start at the proper time, the relevant part starts at 31m58s.