That verse doesn't belong to the Bhagavad-gītā but is taken from the Aśvamedha Parva of the Southern Recension of the Mahābhārata (Kumbakonam Edition):
Ashvamedhikaparva - adhyAya 116
14.116. adhyAyaH 116
Mahabharata - Ashvamedhika Parva - Chapter Topics
kR^iShNena yudhiShThiraMprati bhakagavadbhaktisaushIlyAdyabhAve brAhmaNAnAmapi agnihotrasvAdhyAyAdhyayanAdisatkarmaNAmapi vaiphalyasya shUdrANAmapi bhaktyAdimatAM svochitakiMchitkarmaNAmapi sAphalyasya cha kathanam.. 1 ..
Mahabharata - Ashvamedhika Parva - Chapter Text
kIdR^ishA brAhmaNAH puNyA bhAvashuddhAH sureshvara.
yatkarma saphalaM neti kathayasya mamAnagha.. 14-116-1
shR^iNu pANDava tatsarvaM brAhmaNAnAM yathAkramam.
saphalaM niShphalaM chaiva teShAM karma bravImi te.. 14-116-2
tridaNDadhAraNaM maunaM jaTAdhAraNamuNDanam.
valkalAjinasaMvAso vratacharyA.abhiShechanam.. 14-116-3
agnihotraM gR^ihe vAsaH svAdhyAyaM dArasatkriyA.
sarvANyetAni vai mithyA yadi bhAvo na nirmalaH.. 14-116-4
agnihotraM vR^ithA rAjanvR^ithA vedAstathaiva cha.
shIlena devAstuShyanti shrutayastatra kAraNam.. 14-116-5
kShAntaH dAntaM jitakrodhaM jitAtmAnaM jitendriyam.
tamagryaM brAhmaNaM manye sheShAH shUdrA iti smR^itAH.. 14-116-6
upavAsaratAndAntAMstAdevA brAhmaNAnviduH.. 14-116-7
na jAtyA pujIto rAjanguNAH kalyANakAraNAH.
chaNDAlamapi vR^ittasthaM taM devA brAhmaNaM viduH.. 14-116-8
manashshauchaM karmashauchaM kulashauchaM cha bhArata.
sharIrashauchaM vAkChauchaM shauchaM pa~nchavidhaM smR^itam.. 14-116-9
pa~nchasveteShu shaucheShu hR^idiM shauchaM vishiShyate.
hR^idayasya cha shauchena svargaM gachChanti mAnavAH.. 14-116-10
As the editors of the Critical Edition of the Mahābhārata explain, the above dialogue between Yudhiṣṭhira and Kṛṣṇa is a late addition to the Mahābhārata and is only present in the Southern Recension manuscripts:
The Vaiṣṇavadharmaśāstra Interpolation
The Aśvamedhikaparvan has the distinction of having a very big interpolation or addition (constituting about 1700 ślokas), which is shown by us as Appendix.
The Southern Recension MSS contain this portion which is omitted in all MSS representing the Northern Recension. Sāyaṇa in his Parāśaramādhavīya (B S S Vol I) and Vādirāja, the author of the Lakṣaṇālaṅkāra, have quoted from this section as P P S Sastri has pointed out.
It is purely sectarian (Vaiṣṇavite) work, very conveniently tacked on to the Aśvamedhikaparvan at the end. At the conclusion of the Aśvamedha sacrifice, Yudhiṣṭhira requests Kṛṣṇa to describe the Vaiṣṇavadharma in all its aspects, ritualistic, philosophical, etc. Gods and Brahmarṣis also, desirous of listening to this Dharma saṃvāda, come there. Kṛṣṇa discourses on various matters, such as —
- The Varṇāśramadharmas
- The nature of the three fold Dāna
- Praise of Brāhmaṇas and devotees of the Lord
- Yama loka
- The fruits of Toyānnadāna, Bhūdāna, Kanyā dāna, Godāna, etc
- The five Mahāyajñas, Pitṛtarpaṇa, etc
- Āpatddharma etc
There is not much of philosophy here, the section being intended for the glorification of Vaiṣṇavadharma, and devotion to the Bhagavat. Attention is drawn even to trivial matters, like how one should take a bath or put on his clothes. On the whole, this section can have an appeal only to those who are followers of the Bhāgavata-dharma.