Let us first read a funny anecdote that Sri Ramakrishna said. Sri Keshab Chandra Sen was a very popular religious leader in Kolkotta and he was the chief of Nav Vidhan Brahma Samajam. The Samajam was one of the prominent and powerful spiritual movement in Kolkotta and Kesab had many admirers and followers. He was quite rich. He was a very powerful orator too and admired by many.
He was fortunate to come across Sri Ramakrishna Paramahamsa and got gradually and deeply attracted to the saint. He could understand that whatever lofty spiritual subjects he was lecturing on, Sri Ramakrishna was a living and practical embodiment of them.
He used to listen to Ramakrishna’s freewheeling talks on religion and spirituality in rapt attention.
One day he said to Sri Ramakrishna, “Swami, I want you to teach me much more deeper insights into spirituality”. Ramakrishna said laughingly, “I can teach you alright, but if you listen to them and act on them, your Samajam and all would vanish!”
Swiftly, Keshab said, “then whatever you have taught me is good enough, Swami”.
Hope you get the purport of this story here. Not all religious people are in search of Moksha. Most of them want happy and prosperous life in this world and they want to enjoy life in higher worlds too. If scriptures say ‘if you do these acts of punya, conduct great fire sacrifices, feed poor in large scale, construct temples and so on, God will be pleased with you and give you a life in heaven post death’.
At the same length, people need to be warned of leading a life of extreme suffering in the hell, if they engage in evil and atrocious acts in this life.
Thus Swarga and Naraga have their purpose to ordinary people who are very much bound to Samsara and have no keenness to get out of it. Despite whatever suffering they undergo, people will still cling to life and hope that enjoyment will come in due course.
The concept of moksha is attractive only to spiritually more evolved people who could understand that life is like a dream of never ending wants and hunting behind happiness by trying to meet the wants but not getting it mostly.
For such people, karma yoga is the path — working without attachment to the fruits of Karma. For them freedom from the hopeless cycle of births and death — moksha is the only meaningful goal in life.