I did a search of the web but could not find anything on the origin of the custom.
Most sites discussed a breed of cat - ragamuffen.
Here is what Merriam Webster on-line said:
Main Entry: rag·a·muf·fin
Etymology: Middle English Ragamuffyn, name for a ragged, oafish person
: a ragged often disreputable person; especially : a poorly clothed often dirty child
Staten Island WebŪ Forums Index.