The Talmud teaches that one should not pray in a room without windows. According to Rav Kook, this is because prayer without a recognition of the outside world, one’s responsibilities and duties, is empty. Why should one choose to pray to God in a cramped, narrow corner, unrelated to the vast panorama of God’s world?
The Talmud may also be making the reverse point: not that we look out, but that others must look in. To see someone lift a heart to God can be itself heartening. Knowing devotion exists can kindle our own devotion. Although we cannot be sure what goes on in another’s heart (as Queen Elizabeth famously commented in her declaration of religious tolerance, “I seek not to carve windows into men’s souls”) we can watch others pray and be inspired.
The Baal Shem Tov taught, when you see someone sway in prayer, do not think it strange. Compare it to a man passing by a glass house where inside people are dancing. Since he cannot hear the music, he sees only the strange rhythms. The music may be playing even if we can’t hear it. How do we know? That’s why we have windows.