Another way of saying it:
A Farmer placed nets over the field he'd just planted, catching a bunch of Crows that came to eat his seed. Caught with them was a Stork that had broken his leg in the net.
The Stork didn't want to meet the same fate as the Crows and so begged the farmer for his freedom.
"Please take pity on me and my broken leg," said the Stork, "and let me go - just this once. I'm no Crow; I'm a Stork, a bird of excellent character."
The Stork continued. "I respect and work for my mother and father. And look: my feathers are nothing like that of a Crow."
The Farmer snickered.
"You may be as you say, but what I know is this: I caught you with thieves, and so I will treat you like a thief."
Comment: Like many of Aesop's Fables, the Farmer and the Stork can seem a little harsh today. In the original the Stork pleads for his life; I've softened the translation to leave him pleading for his freedom.
You'll find a very similar moral is conveyed in The Ass and His Purchaser - the message of which is You Are Judged by the Company You Keep - but without the life and death nature of the story.
Notable: In the original, Cranes are the scavengers the Farmer catches, not Crows. In light of the endangered status of some Cranes, and the fact that we're more likely today to see scarecrows than scarecranes, I made the change.
How to use Aesop's Fables.
More stories with morals.
Storytelling to improve behavior.