And why can some felines roar while others meow?
It makes sense that the ability to express your emotions improves the quality of the interaction you have with those around you. If a cat purrs those around it know it's feeling good, which can be useful information for future interaction.
I'm sure there have been cats who had a worse life because they didn't bond as well because they didn't purr, and consequently had a slightly lesser tendency to have their DNA end up in the next generation.
This argument goes for every ability to express emotions.