When there are so many jatis and each lives separately from the rest, how can the community remain united as a whole? But the fact is unity did exist in the past. Indeed it is now that our society is divided because of ill-will among the various groups. The binding factor in the past was faith in our religion and its scriptures. The temple strengthened this faith and the sense of unity, the temple which belongs to the whole village or town and which is situated at its centre. People had the feeling of togetherness in the presence of Isvara as his children. In festival all jatis took part contributing to their success in various ways.
In the rathotsava (car festival) of a temple, all sections including Harijans pulled the chariot together. On returning home they did not bathe before eating. This practice has the sanction of the sastras. [Talking of the past] it was a time when people were divided in their callings but were of one heart. Though stories are concocted that there was no unity since society was divided into a number of jatis, the fact is people then had faith in the sastras and in the temples and this faith was a great unifying force. Today, ironically enough, hatred and enmity are spread between the various jatis in the name of unity. That is the reason why nowadays the cry against the caste has become a cry against the vedic dharma and temples.
The vedas themselves proclaim that when a man attains to the highest state [that is jnana] he does not need either the Vedas themselves or the temples. The Upanisads too have it that in the state of jnana or supreme awareness the Vedas are not Vedas, the Brahmin is not a Brahmin, the untouchable is not an untouchable. It is to reach this state - the state in which the Vedas and all the differences in society cease to be- that you need the very Vedas, temples and caste differences. The condition of utter non-difference, may it be noted, is realised through these very means.
He who constantly strives to be free from worldly existence ultimately discovers that everything is one, so proclaim the Vedas. Krsna Paramatman pronounces the same truth when he says that in the end there is worklessness -"Tasya karyam na vidyate".
In the phenomenal world with its works and day-to-day affairs, it does not make sense to claim that there are no differences. The sastras, however, teach us that even in such a world we must be filled with love for all castes, for all creatures and we must look upon all as the same without regarding one as inferior to the rest or superior. It means the attitude of non-difference is in love, not in karma. "We must always feel inwardly that all are one and we must be permeated with love for all. But in karma, in action there must be differences," such is the teaching of the sastras.
"Bhavadvaitam sada kuryat, kriyadvaitam na karayet", so it is said. Oneness must be a matter of our feelings, not our actions. Unless differences are maintained outwardly the affairs of the world will be conducted neither in a disciplined nor in a proper manner. It is only then that Atmic inquiry can be practised without confusion and without being mentally agitated, In sanatana dharma worldly life has been systemised as though it were real for the very purpose of its being recognised and experienced as unreal.
In this worldly life, the four varnas developed branches and many jatis came into being. From the saptasvaras (the seven notes) are formed the 72 melakarta ragas. And from them have developed countless musical modes called janya ragas. In the same way, from the four varnas the numerous jatis were born. Separate dharmas separate customs and rites, evolved for these jatis.
For a general background, please see here