(idiomatic) To give things of value to those who will not understand or appreciate it.
Origin of cast-pearls-before-swine
From the Bible
"Give not that which is holy unto the dogs, neither cast ye your pearls before swine, lest they trample them under their feet, and turn again and rend you." – KJV
, Matthew 7:6