Sirius Black was an escapee from Azkaban, he was wanted by the authorities and a reward was being offered for his capture. Lupin had the job that Snape wanted and getting Lupin up on charge of aiding an escaped criminal would have made the spot vacant once again.
Not to mention he had hated them since they were in school together.
Chat with our AI personalities
It was actually planted much earlier, to allow Sirius Black to go to school (as a path to the shrieking shack.) It was actually planted to keep people from getting to the Shrieking Shack, as going under the tree was the only way to get there. It was meant to keep people from getting to Moony, aka Professor Lupin, who as we all know is a werewolf. It was to keep people from getting to him when he was at school and when he turned, as well as, to keep him from getting to other people. I think the third book tells you this. Oh...and i almost forgot, I think it was actually enchanted during James', Sirius', and Lupin's years at Hogwarts.
Yes, at some point during their years at Hogwarts, Sirius Black tricked Severus Snape and told him that if he was to go the Whomping Willow and press a certain branch he would see something. James Potter found out just in time and stopped Snape from going into the shrieking shack where he would have met Remus Lupin, in werewolf form.
the shrieking shack
He is a werewolf. During his time at Hogwarts, he goes into the Shrieking Shack to change into a wolf every month at the full moon because he becomes quite dangerous.
Snape dies in the shrieking shack because Voldemort kills snape so that he becomes the rightful owner of the deathstick