Why is the animal put to death? What did it do wrong?
Rashi #1: Because man sinned on account of it 1 - how much more so will a person, who possesses intelligence, be taken to task for causing others to sin.
Rashi: And it is by the same token that the Torah later (in Re'eh, Devarim 12:2), orders all the trees that the Cana'anim worshipped to be cut down, even though the trees can neither see nor hear - how much more someone who turns his fellow-Jew away from the path of life to the path of death.
See Rashi there.
If the sinner is killed by stoning, how is the animal put to death?
Targum Yonasan: By beating it with a club.