And when you pray, you shall not be like the hypocrites. For they love to pray standing in the synagogues and on the corners of the streets, that they may be seen by men. Assuredly, I say to you, they have their reward. But you, when you pray, go into your room, and when you have shut your door, pray to your Father who is in the secret place; and your Father who sees in secret will reward you openly [Mat 6:5-6]
These too again He calls hypocrites, and very fitly; for while they are feigning to pray to God, they are looking round after men; wearing the garb not of suppliants, but of ridiculous persons. For he, who is to do a suppliant’s office, letting go all other, looks to him alone, who has power to grant his request. But if you leave this one, and go about wandering and casting around your eyes everywhere, you will depart with empty hands. For this was your own will. Therefore He did not say “such shall not receive a reward”, but, “they have it”: that is, they shall indeed receive one, but from those of whom they themselves desire to have it. For God does not want this: He rather for His part was willing to bestow on men the recompense that comes from Himself; but they seeking that which is from men, can be no longer justly entitled to receive from Him, for whom they have done nothing.
But mark, I pray you, the lovingkindness of God, in that He promises to bestow on us a reward, even for those good things which we ask of Him.
Having then discredited them, who order not this duty as they ought, both from the place and from their disposition of mind, and having shown that they are very ridiculous: He introduces the best manner of prayer, and again gives the reward, saying, go into your room. What then, it may be said, should we not pray in church? Indeed we should by all means, but in such a spirit as this. Because everywhere God seeks the intention of all that is done. Since even if you should go into your room, and having shut the door, should do it for display, the doors will do you no good.
It is worth observing in this case also, how exact the definition, which He made when He said, That they may be seen by men. So that even if you shut the doors, this He desires you duly to perform, rather than the shutting of the doors: to shut the doors of the mind. For as in everything it is good to be freed from vainglory, so most especially in prayer. For if even without this, we wander and are distracted, when shall we pay attention to the things which we are saying, if we have this disease also? And if we who pray and beseech do not pay attention, how do we expect God to pay attention?
[St. John Chrysostom, Homily 19 on the Gospel of St. Matthew]