The song is a sixteenth century mendicant's song. There were many quite different versions of the song, only one of which is currently sung to my knowledge. This one is actually told from the point of view of Mad Maudlin, who is Mad Tom O'Bedlam's female counterpart and paramour--just as Bedlam came from the Bethlehem Hospital, Maudlin apparently came from the Mary Magdalene Hospital, a female asylum.
The most common versions were clearly asking for money, and "Mad Tom" was apparently just a stereotype of the harmless madman that beggars played to to gain sympathy. Much of what is described is supposed to be the visions of a lunatic--so, there are fairies and elves in the song. But the chorus seems to refer to the lunatics themselves, and to the fact that they go naked, live outdoors, and need neither liquor nor money--perhaps mentioned as a prelude to begging for food.
Your best reference source is probably the book "Loving Mad Tom" by Robert Graves, Jack Lindsay and Peter Warlock.
The tune usually used (by Steeleye Span and others) was put together by Nic Jones and Dave Moran in their band The Halliard, in the early 70s.