The last page of the story tells the reader that Dr. Roylett:
1. clamped the bed to the floor and installed a rope next to it --- a rope that appeared to have no purpose.
2. ordered snakes from India - snakes with venom unknown to others
3. put the snake in the ventilator
4. trained the snake to respond to a whistle using milk
Sherlock Holmes attacked the snake when it made its way through the ventilator. He arroused its temper with the beating it took and it attacked the first person it encountered, Dr. Roylett.
Sherlock says in the last sentence of the story,
"I am NO DOUBT indirectly responsible for Dr. Grimesley Royett's death, and I cannot say that it is likely to weigh very heavily on my conscious." (pg 13 - last sentence of the story)
Dr. Roylett would not have died if he had not set up the situation.