It was first Simpson's episode, but i remember hearing it much earlier.
It's a good question, but the origins are not precisely known. What is known is that the lyrics, or variations on it, existed at least as far back as 1967. Considering the popularity of the Dozer/West Batman TV series of the '60s, that seems the most likely inspiration for the song as huge numbers of children were watching the show at that time and Batman became a cultural phenomenon. We can't be certain, though, since the lyrics come to us primarily through transmission from person to person, not from any specific piece of media that we can conveniently date. Batman comics were around long before this, so it's conceptually possible that it originated even earlier but was not widely known until after the TV series.
The lyrics "Jingle Bells / Batman Smells / Robin Laid an Egg / The Batmobile Lost a Wheel and Joker Got Away" did appear on an episode of Batman: The Animated Series called "Christmas with the Joker", airing in 1992. You can see the clip in question on youtube here.
We do not have a bounty of sources for this information. There is The Popular Song Reader: A Sampler of Well-Known Twentieth-Century Songs. I feel embarrassed citing it, but the most direct investigative work on this particular issue was actually done by a Cracked.com article. I would like to emphasize that this is NOT a rigorous historical source, but it does presents an excerpt from one primary document dated to the 1960's. There are plenty of people who claim to remember the rhyme from their school days in the 1960's and 1970's, but as far as I can tell this is the only known document recording it. I suspect there are far more than just this, but until somebody does some more primary historical research, we're not likely to find it.