It creates a soothing affect in other animals. It lets you know they're happy and calm. It also makes other animals calm.
When a kitten is nursing it will purr. This makes the mother cat relax and thus produce more milk for the kitten. People like to hear them purr when they scratch them so they continue scratching. (Although this is less concious than anything on both parts)
I had a kitten for awhile that was neglected and abandoned by its mother. That kitten would purr when it slept, ate, or just sat on your lap.