Shulchan Arukh, Yoreh De'ah 282:1שולחן ערוך, יורה דעה רפ״ב:א׳
Respectful behavior toward a Torah scroll, and the law of its use. Herein are contained 19 sections:
One must behave with great respect toward a Torah scroll, and is commanded to designate a special place for it which one must treat with respect and which one must decorate (beautify) greatly. One may not spit in front of a Torah scroll, nor may one undress (to the point of nudity) in front of it, nor may one scuff one’s feet (on a dirt floor) in front of it, nor may one place it upside down. Also, one may not turn one’s back on it unless it is [sitting on something] ten handbreadths higher [than the person is tall – to be above the turned back]. Rather, one should sit before it with the proper mindset (for prayer), and with awe and fear, since this (Torah scroll) is [considered] the trusted witness regarding [the deeds of] all who live on earth, as it is said, “(Take this book of the Teaching [which can also be read: ‘Take this Torah scroll’] and place it beside the Ark of the Covenant of Adonai your God,) and let it remain there as a witness against you.” (Deuteronomy 31:26), and one should respect it according to its power.
One must behave with great respect toward a Torah scroll, and is commanded to designate a special place for it which one must treat with respect and which one must decorate (beautify) greatly. One may not spit in front of a Torah scroll, nor may one undress (to the point of nudity) in front of it, nor may one scuff one’s feet (on a dirt floor) in front of it, nor may one place it upside down. Also, one may not turn one’s back on it unless it is [sitting on something] ten handbreadths higher [than the person is tall – to be above the turned back]. Rather, one should sit before it with the proper mindset (for prayer), and with awe and fear, since this (Torah scroll) is [considered] the trusted witness regarding [the deeds of] all who live on earth, as it is said, “(Take this book of the Teaching [which can also be read: ‘Take this Torah scroll’] and place it beside the Ark of the Covenant of Adonai your God,) and let it remain there as a witness against you.” (Deuteronomy 31:26), and one should respect it according to its power.
Mishneh Torah, Tefillin, Mezuzah and the Torah Scroll 10:10משנה תורה, הלכות תפילין ומזוזה וספר תורה י׳:י׳
It is a mitzvah to designate a special place for a Torah scroll and to honor it and glorify it in an extravagant manner. The words of the Ten Commandments are contained in each Torah scroll.
A person should not spit before a Torah scroll, reveal his nakedness before it, take off his footwear before it, or carry it on his head like a burden. He should not turn his back to a Torah scroll unless it is ten handbreadths higher than he is.
A person should not spit before a Torah scroll, reveal his nakedness before it, take off his footwear before it, or carry it on his head like a burden. He should not turn his back to a Torah scroll unless it is ten handbreadths higher than he is.
Turei Zahav on Shulchan Arukh, Yoreh De'ah 282:1טורי זהב על שולחן ערוך יורה דעה רפ״ב:א׳
...