Traditionally, Chandalas and I believe even Sudras were not allowed in temples.
What was the justification for this and is it based on scriptures?
Hinduism Stack Exchange is a question and answer site for followers of the Hindu religion and those interested in learning more about Hinduism. It only takes a minute to sign up.Sign up to join this community
PV Kane in his History of the Dharma Sastra Vol 2 Part 1 Page 93 says
There is no taint of untouchability when a person is touched by an untouchable in a temple, religious processions and marriages, in sacrifices, and in all festivals’ (Atri verse 249). Sātātapa quoted in the Smriti Candrika declares that there is no doṣa in touching untouchables in a village on the public road or in a religious procession or in an affray and the like, and also when the whole village is involved in a calamity. Brhaspati also remarks that there is no fault and so no prāyaścitta if one comes in contact with untouchables at a sacred place, in marriage processions and religious processions, in battle, when the country is invaded, or when the town or village is on fire. The Smṛtyārthasāra summarises the places where no blame in incurred on the ground of mixing with untouchables viz. in battle, on public roads leading to a market, in religious processions, in temples, in festivals, in sacrifices, at sacred places, in calamities or invasions of the country or village, on the banks of large sheets of water, in the presence of great persons, when there is a sudden fire or other great calamity. It is somewhat remarkable that the Smṛtyārthasāra speaks of untouchables entering temples. Nirnaya-sindhu quotes a passage of the Devī-Purāṇa that expressly authorizes antyajas to establish a temple of Bhairava.
There is no traditional justification for not allowing Chandalas to enter into Temples. According to Vaishnava Puranas and Agamas, its forbidden to practice untouchability against devotees irrespective of Caste.
There are no distinctions among such pure devotees in terms of social class, education, bodily beauty, family status, wealth, occupation, and so on. (Narada Bhakti Sutra 72)
Yogis are born among all castes; and no caste-odium shall hold in their cases, for they have seen their souls. (Bharadvaja-Samhita,1.44).
Even a person born in a family of dog-eaters immediately becomes eligible to perform Vedic sacrifices if he once utters the holy name of the Supreme Personality of Godhead. Even if born in the families of dog-eaters, such persons are worshipable. Persons who chant the holy name of Your Lordship must have executed all kinds of austerities and fire sacrifices and achieved all the good manners of the Aryans. To be chanting the holy name of Your Lordship, they must have bathed at holy places of pilgrimage, studied the Vedas and fulfilled everything required. (Srimad Bhagavatam 3.33.6–7)
A Chandala who is a pure Vaishnava at heart and who decorates the eleven parts of his body with Vishnu-Tilaka and sandalwood paste is always worshipable, even by the best of Brahmanas. (Padma Purana, Uttara Khanda 66.84)
A Bramhana who is expert in studying all four Vedas is not dear to Me. But a devotee who comes from a family of Chandalas is dear to Me. He should be offered gifts and one should accept gifts from him. He is as worshipable as I am. (Hari-Bhakta-Vilasa 10.127)
If a devotee of Vishnu, even though he be a Chandala, is recollected, named, seen or touched accidentally by anybody, O dear madam, the former purifies them. (Varaha Purana 211.9)
Oh Lord at Sri Rangam! Even brahmins in the top caste, Learned in all the four Vedas and their six adjuncts, will become outcastes, should they decry Your devotees in the low caste. (Thirumaalai,43)
It is through deep love that the Chandala makes me his own, while without it the Brahmin is nothing to me. (Garuda Purāṇa 1.231.9)
This being said, When Scripture say Chandala devotees are worshippabe, their touch purifies Brahmanas and they have aquired merit of reading Vedas and holy piligrimages, they can enter the Temples. Thirupan Alvar a Panchama was carried inside by a Preist on his head!! Pillai Lokacharya said birth in lower caste is better for Moksha for they have humility. From "The Life of Ramanujacharya"
Ramanujacharya gave Panchamas the title of “Tirukkulattar” or the “Blessed Descendants,” and further allowed them the privilege of entering into the Holy Temples. Ramanuja opened the doors of religious instructions for these classes, as well as certain modes of ritual and other privileges peculiar to Sri-Vaishnavas, such as the Pancha-Samskara or the Five Holy Vaishnava Sacraments. It is thus evident how seriously had Ramanuja bethought of elevating the low-classes as regards their eligibility for salvation. Ramanuja had already confirmed too in his own days, what his predecessors had ordained, viz.,the enshrinement of saints in the Temples, to whatever caste they may belong to.
Edit : I found a proof from Bramha Purana that Chandala worshipped Lord Vishnu in temple and also visited many sacred pilgrimages.
On the outskirts of the city named Avanti lived a Chandala. At night he would go to Vishnu’s temple and sing praises of Vishnu. He never failed to observe this ritual...The Chandala went to the temple. He worshipped Vishnu and spent the night in singing Vishnu’s praises..