Based on these pesukim the Gemaras in Megilla 29a and Brachos 63a learns that there is a mitzvah, when one walks into shul to daven, to walk through one entrance and leave through another entrance in order to walk through the shul. The Korban Nesanel on the Rosh in Megilla asks how we learn this mitzvah by a shul from the pasuk in Yechezkel which only talks about every Jew coming three times a year to the Beis HaMikdash; how does the gemara apply it to a shul all year around? He answers that really if a Yisrael would come at any point of the year he should go through the side entrance either on the north or south side and leave on the opposite exit, but he only has a mitzvah to come up and show himself in the Beis HaMikdash 3 times a year. In context , the pesukim were telling us that the Kohen in charge of the service who would normally go through the main entrance on the east side and leave from where he came throughout the year, should follow what everyone else is doing and enter from one side entrance and leave through the other side entrance (Rosh perek 4, paragraph 9, note shin).
Why is it a mitzvah to walk through the shul if you are coming to daven? The R”an in Megilla says “The reason is that it appears like you love it” (see Mishna Berura 151:5:21).
The R”an speaks in very peculiar terms. What does he mean when he says “The reason is that it appears like you love it,” Hashem looks into our hearts and knows whether we appreciate and love Him and His holy places. Isn’t coming to pray in front of Hashem a show of love for Him? Within the words of our prayers we express our love! Either we feel the love already and express it through our prayers or if we don’t really feel it and we are just giving lip service then what does walking through the shul which makes us appear that we love it do if Hashem really know what is in our hearts? We can’t fake Him out!
It must be that by walking through the shul and making it appear like you love it actually infuses more love inside ones heart, and whatever feeling of love one had before is intensified through the act of walking through the shul.
The Divrei Chamudos, a commentary on the Rosh in Brachos has another application of this halacha. When a person is called up for an aliyah he should go up to the Torah the shortest possible way and then when he is finished he should go back to his seat the long way (Divrei Chamudos on the Rosh Perek 9, paragraph 29, note 101). (Click Here for Hebrew Text.)
The message is clear. By walking up to the Torah as quickly as possible and then taking time to walk back to one’s seat he is showing his love for Hashem and His Torah. By expressing one’s feelings it increases his or her emotions in their heart. Actions don’t just show how one feels it also increases feelings.