Because it’s not universally poisonous - it’s allergenic to humans and perhaps some other mammals, but to many other animals it has no effect. Disguising the shape of leaves protects the plant from insects who might identify their favourite snacks by appearance (and whose immune systems are not fancy enough to allow an allergic reaction, incidentally).