Despite claims this phrase originated on "The Simpsons", it actually existed long before it was used in the show. The phrase is intended to portray the distortion of facts when passed from person to person.
Its use in "The Simpsons" was accurate; Bart starts a rumour by whispering to one person who whispers it to another, etc. By the time the rumour reaches the front of the crowd, the phrase "Purple monkey dishwasher" has been added to the end due to people mishearing the original rumour as it passed from person to person.
Due to the popularity of "The Simpsons", the phrase has since become a commonly used response to opinions stated based on hearsay and unconfirmed rumours.
Person A - "I heard from a friend of a friend that John cheated on Linda with Karen!"