This is a parody of lyrics by Mason Williams, best known for the instrumental piece “Classical Gas”, which was a brief hit on the Smothers Brothers comedy show.
The original lyrics were for “dog kickers”, which made it easy to parody.
Classical gas is one of my favorite instrumental pieces of music from that era along with “Alley cat” and “Grazing in the grass”, and now that you mention it I do remember it as being on the Smothers brothers show.