It's one of those idioms I don't fully understand. You got me.
I thought for a long time that it simply meant don't be foolish enough to turn down something for free, but it's about etiquette and manners. If someone is kind enough to give you a free (horse) don't insult them by checking its teeth.