For me personally, the purpose of life is to find what out what’s the purpose of life itself. Confusing I know but I have accepted that one as my own personal truth. As for the bad people, I believe that they’re there to show exactly what we should never become as well as to show us that the nice people around us actually make extra effort to be nice to us and therefore, deserve more appreciation.
I’m a firm believer that everyone exists for a reason. The rich exists to help the poor and the poor exists to give a chance to the rich to be a better person and lend a helping hand. Maybe I’m wrong but I think we all serve a purpose in this life :)