Originally, the name was a term of authority. At the Eszterházy court, Haydn was (after 1766) the Kapellmeister; that is to say, the boss, for a fairly large group of musicians. Haydn's authority was evidently rather benevolent, as he often interceded with Prince Eszterházy on behalf of musicians who had gotten in trouble in some way. The famous tale of the Farewell Symphony also attests to Haydn's willingness to act on behalf of his subordinates. The term "Papa" doubtless became more and more plausible as Haydn's 30-odd years of service in the Eszterházy court went by; gradually, he would have become increasingly older than the average musician serving under him.
Another sense of the term "Papa Haydn" comes from his role in the history of classical music, notably in the development of the symphony and string quartet. While Haydn did not invent either genre, his work is considered important enough in establishing these genres that the labels "Father of the Symphony" and "Father of the String Quartet" are often attached to him. This view was prevalent in Haydn's own lifetime: in 1797, the Tonkünstler-Societät of Vienna passed the resolution making him a life member, "by virtue of his extraordinary merit as the father and reformer of the noble art of music."
After Haydn's death (1809), during the 19th century, the term "Papa Haydn" became something of a stereotype, designating to many a kindly, perhaps doddering old man whose music was very simple and thus suitable for children. The stereotype is a counterpart to the evolution of Mozart's reputation during the same period: Mozart died too young to become "Papa Mozart", but nevertheless was often regarded during this era as a kind of porcelain figure.
With the rise of Haydn's critical stock during the 20th century, scholars and critics became rather leery of the term, as a distortion of the composer's work. For instance, Jens Peter Larsen wrote (1980) in the New Grove encyclopedia:
However, since materials of music education still tend to reflect 19th century sources, the term is well known to the musical public.
This little rhyme goes with the first bars of the Surprise Symphony: