देहो देवालयः प्रोक्तः जीवो देवस्सनातनः ।
त्यजेदज्ञाननिर्माल्यं सोऽहं भावेन पूजयेत् ॥
deho devAlayaH proktaH jIvo devassanAtanaH |
tyajedaj~nAnanirmAlyaM so.ahaM bhAvena pUjayet ||
Which scripture is the source of the above sloka?
You can find it in the 2nd Adhyaya of Maitreyi Upanishad:
स होवाच महादेवः ॥
देहो देवालयः प्रोक्तः स जीवः केवलः शिवः ।
त्यजेदज्ञाननिर्माल्यं सोऽहम्भावेन पूजयेत् ॥ १॥
sa hovAcha mahAdevaH ||
deho devAlayaH proktaH sa jIvaH kevalaH shivaH |
tyajedaj~nAnanirmAlyaM so.ahambhAvena pUjayet || 1||
Lord Shiva says this verse (Sa hovacha Mahadeva). It is the 1st verse of the 2nd chapter of the Upanishad.
Maitreyi Upanishad is a minor Upanishad linked with the Sama Veda (as per Muktika Upanishad's list). It is also known as Maitreya Upanishad.
NOTE: The verse I have given is almost matching with the verse you have given in the question. In my verse it is "Sa jivah kevala shivah" where as in your verse it is "Jivo devas sanatanah". This is the only difference.