The purpose in the Holy Quran, by narrating these stories, is that we should learn a lesson both on individual and collective levels, and then change our lives according to Allah's will, in order to better the world around us, in implementing a more socially just, goodwill towards man, and other positive aspected lifestyle.