“Some children were playing beside a river. They made castles of sand, and each child defended his castle and said, ‘This one is mine.’ They kept their castles separate and would not allow any mistakes about which was whose. When the castles were all finished, one child kicked over someone else’s castle and completely destroyed it. The owner of the castle flew into a rage, pulled the other child’s hair, struck him with his fist and bawled out, ‘He has spoiled my castle! Come along all of you and help me to punish him as he deserves.’ The others all came to his help. They beat the child with a stick and stamped on him with their feet. Then they went on playing with their sand castles, each saying, ‘This is mine; no one else may have it. Keep away! Don’t touch my castle!’
“But evening came, it was getting dark and they all thought they ought to be going home. No one now cared what became of his castle. One child stamped on his, another pushed his over with both hands. Then they turned away and went back, each to his home.”
Source: Yogacara Bhumi Sutra 4.
This parable appears in Jack Kornfield’s book, Teachings of the Buddha.
It also appears in this online collection of Buddhist parables: