I'm not sure that I'd agree that wild animals have a "purpose" - unless they are trained, eg drug sniffer dogs have a purpose, because we use them specifically for the task. Vermin are only vermin when we define them as such - rats and mice, like all other creatures on the planet, are only doing their best to survive, and it's not their fault that this doesn't fit in with us. The good they do is in simply being there and being part of Earth's biodiversity. And being food for snakes.