Psychology Today has the attribution
I once read about five monkeys that were placed in a room with a banana at the top of a set of stairs. As one monkey attempted to climb the stairs, all of the monkeys were sprayed with jets of cold water. A second monkey made an attempt and again the monkeys were sprayed. No more monkeys attempted to climb the stairs. One of the monkeys was then removed from the room and replaced with a new monkey. New monkey saw the banana and started to climb the stairs but to its surprise, it was attacked by the other monkeys. Another of the original monkeys was replaced and the newcomer was also attacked when he attempted to climb the stairs. The previous newcomer took part in the punishment with enthusiasm. Replacing a third original monkey with a new one, it headed for the stairs and was attacked as well. Half of the monkeys that attacked him had no idea why. After replacing the fourth and fifth original monkeys, none had ever been sprayed with cold water but all stayed away from the stairs.