According to Advaita Vedanta, things like caste, gotra, etc, will cease to exist after realization. But when Adi Shankara met a Chandala in Varanasi, he asked the Chandala to move away from his path. Chandala inquired that whether Adi Shankara is asking my body to move away or the real me to move away. Then Shankara responded by writing Manisha Panchakam. Later it is believed that he accepted the Chandala as his disciple.
Now if caste or varna cease to exist after realization and Adi Shankara realised himself, why did he practice untouchability?