As with most things, the term started because of birds. As you know, 6,000 years ago, God created the Earth. After filling the planet with enough tricks to make someone/something believe and effectively prove the theory of evolution, he decided to make a creature that was smart enough to discover the evidence for evolution, but not smart enough to understand it was a big joke. So, God made man.
After that, he made a bunch of animals including birds. God has been quoted as saying that this is where He messed up. He tried making birds awesome by turning them into dinosaurs, but then He thought, “What am I even doing this for? I’m God. I can’t be second-guessing myself or what are people going to think?” So He threw the dinos way underground to stick with His evolution trick. After throwing away the dinos, he decided to give birds a chance by giving Adam, the first man, a pet chicken.
One day, Adam, while trying to catch his chicken, accidentally kicked over God’s lunch bucket. God looked at Adam, then at his spilled lunch. He then had a nice long laugh at the hi-jinx that just occurred. He then turned to Adam and said, “Man will know death.”
And that’s why they refer to dying as “kicking the bucket”.