It says in the Shulhan 'Arukh that there is an opinion that one should not go out for a stroll on Tish'ah BeAb, so that one will not come to laughter and lightheaded behavior. Even though it says that "there is an opinion", we should understand that there is no contradictory opinion, and that this is the accepted Minhagh.
It is important to understand that the reason for not taking walks is so that one will not take one's mind off the seriousness of the day. Therefore, when one is sitting in the Synagogue or Beth Midrash, one must also keep the seriousness of the day in mind, and behave appropriately.
One must fight the temptation of the Yeser Hara' to make people stumble whenever there is a group of people assembled together, to make them joke and behave in a lightheaded manner. One must be careful of this at any time, but on Tish'ah BeAb it would be a serious error of judgment.
(See Shulhan 'Arukh, O.H. 554:21. Kaf Hahayyim, ibid., Oth 95, 96)
9th of Ab, Tishah B'av, Tish'ah BeAb, Going for walks on Tisha B'av