Purpose of the universe is for Allah SWT to express His Infinite Love to His Servants who believe in Him and Love Him and in turn Allah SWT loves them even more. We are made of stardust from galaxies, we are Infinite Beauty, the Art of the Heart of Allah SWT
Here is the proof:
﴿سورة يونس ٤﴾ إِلَيْهِ مَرْجِعُكُمْ جَمِيعًا ۖ وَعْدَ اللَّهِ حَقًّا ۚ إِنَّهُ يَبْدَأُ الْخَلْقَ ثُمَّ يُعِيدُهُ لِيَجْزِيَ الَّذِينَ آمَنُوا وَعَمِلُوا الصَّالِحَاتِ بِالْقِسْطِ ۚ وَالَّذِينَ كَفَرُوا لَهُمْ شَرَابٌ مِنْ حَمِيمٍ وَعَذَابٌ أَلِيمٌ بِمَا كَانُوا يَكْفُرُونَ
[Quran 10:4] To Him is your return, altogether. The promise of God is true. He originates creation, and then He repeats it, to reward those who believe and do good deeds with equity. As for those who disbelieve, for them is a drink of boiling water, and agonizing torment, on account of their disbelief.
This ayat proves the only real reason that the universe exists is because of the believing servants. So we derive an instructive lesson in this ayat, that We ourselves are the reason and meaning for Life, and as much as it is Love of Allah and Love for Allah, and Love from Allah, it is also the Love amongst ourselves that is Most High.
Now consider the mercy of Allah SWT who is free of need, when we do wrong we do not hurt Allah in the least but rather we hurt The Miracle of our Creation, that Love from Allah that is Most High. This ayat proves that the FUNDAMENTAL purpose of the universe is Divine Love, it is Allah’s Love Story of Eternity. It makes you realise that you never want to wrong yourself because Life is such a precious gift that there IS NO PURPOSE OR GAIN from doing evil deeds because you are only losing yourself the mercy from Allah SWT, and Allah SWT is Most Kind, Most Loving.
It shows a stimulus or incentive to do great works of Good not because of punishment but because of doing JUSTICE to Allah’s Mercy. It is as if the punishment is an afterthought and the Mercy is the driving dominant factor that shall be the spiritual starlight by which we navigate the night time days of darkness in the dunya until we arrive for Fajr Salah on the day of Qiyamah, the Supreme DayBreak