It means that something precious should not be wasted on those who are incapable of appreciating its value.
An example might be that one wouldn't use a subtle and sophisticated piece of reasoning on someone who couldn't understand it.
Its origins are Biblical (I think) and are something like 'Cast not your pearls before swine'.