"There once was a shepherd boy who was bored as he sat on the hillside watching the village sheep. To amuse himself he took a great breath and sang out, 'Wolf! Wolf! The Wolf is chasing the sheep!'"
Of course, the villagers come to his aid, more than once (as he found their response more amusing than tending sheep), and the result of his false alarms is that when an actual wolf shows up, no one will listen and the little liar gets eaten.
The tale can be traced back as far as the writings of Ancient Greece. The negative consequence is intended to teach children that honesty is important, and that false alarms will lead to people not believing you.