Rats certainly serve a purpose in our ecosystem. For one, rats help to keep the insect population down by eating crickets, beetles and more. Also, rats are food for larger animals including owls, hawks, and falcon.
Rats, like most animals, play an important part in the ecosystem. Without them, our ecosystem would be unbalanced.