Speaking in a bathroom invokes an evil spirit:[1]
The Arizal warned that it is forbidden to speak even one word in a bathroom being that one who does so invokes the evil spirit called Tanya[2] to reside in him. This spirit entices one to sin[3] and causes danger[4].
[1] Sefer Chareidim 47:7; Amudei Hashulchan 4:3; Shulchan Hatahor [Komrana] 3:3; Oar Yisrael [printed 1700] in name of Arizal brought in Kaf Hachaim 3:6; Y.D. 116:113
[2] See Beis Rebbe p. 106 in name of Tzemach Tzedek: There is a Kelipa called Tanya which prevents one’s learning of Penimiyus Hatorah, as through learning Penimiyus Hatorah one abolishes this Kelipa. It is for this reason that the Alter Rebbe began the Tanya with the word Tanya and it is hence called Tanya.” This concept of the Kelipa called Tanya fighting against learning Penimiyus Hatorah is brought in Kisvei Arizal in the Pirush on the Idra; Oar Ganuz 2:19.
[3] Shulchan Hatahor ibid
[4] Sefer Chareidim ibid