A minor internet meme from the days of AOL chat, this is. It stems from a chappie on SomethingAwful who called himself "Bloodninja" and spent his time trolling AOL chat for alleged teenaged girls (probably middle aged creephats in reality) to have cybersex with. Upon where he would fail to take it seriously.
The classic line comes from an episode where he was talking to this woman called "Britneyspears14" and seeing if he could persuade her to do some cyber-Dungeons-and-Dragons-like sex roleplaying. To get prepared for this, he said, "I put on my robe and wizard hat." Initially she appreciated the idea of some dressing up but then when he started casting spells to make her more beautiful and his cock ten times as long she lost interest.
Under an assumed name, "eminemBNJA," he attempted to woo this fair maiden (who am I trying to kid?) with the line again and got a snarky response and an ignore.
This caused much consternation on the Internets, and now it is a meme. Amongst other places, the PC adaptation of Temple of Elemental Evil from 2003 gives any mage as starting equipment a "robe" and a "wizard hat." There are other references as well, if you want to go looking for them.
But why is it so funny? Well, my thoughts go along the metaphorical. A wizard hat is an interesting shape. Pointy and long, a bit phallic. As you pull it onto your head, you might be reminded of pulling something else over your... other... head. If you get my drift. Then again, in old school Dungeons and Dragons and other places of a thud and blunder bent, one generally does not expect the party's wizard to be much of a lurrrve god. Having STR 9 and CON 11 does not excite the ladies so much as a Vorpal Hammer of Cranium Denting +5 would, and your average random nude big-titted wench can't cling to the thighs of someone to whom the Random Number God was so tight when rolling for STR. And the whole having to memorise spells every day leaves little time for the sports of Venus or suchlike. No, if you were going to do a whole Dungeons & Dragons bedroom role-play, you, the gentleman, would probably be more wont to appear as Hrothgar Kjeldulfsson, 17th-level berserker whose sword is constantly wet with the blood of his slain foes and whose pork sword is constantly wet with... other things. Real Eye of Argon stuff. This is why Goreans exist, I'm sure of it.
Then there's the sheer ridiculousness of the costume. Could you take someone seriously dressed in a floor length dressing gown and a sparkly dunce cap? Well no. Especially not in the bedroom. You'd spend your time laughing rather than getting all aroused, surely. I know I would. (Besides, if I were a mage in a fantasy novel, I'd wear a long coat over trousers and a big hood instead. Far more sinister.)
Other than that, I really don't know what else to say.