There are occasions when a family acts together as a single social and emotional entity in the service of God–for instance, during the Shabbat meal or even more so during the Passover Seder.
But there is no place for such things in the synagogue, where they can even become an obstruction.
Because of this, our sages have ruled that a person may not kiss his little children while he is in the synagogue, so as not to mingle other forms of love with the love of God. (Shulhan Arukh, Orah Hayyim 98:1.)
In a certain sense, the soul’s direction in prayer is in principle a “vertical” one, from below to above, whereas the “horizontal” relationship between man and his fellow men-which is present in all prayer, and especially in communal prayer-is of secondary importance, its function being only to help and direct the worshipper to elevate himself through prayer.
Hence, any emotional direction that is not germane to the basic purpose of prayer, to the attempt to merge oneself with the entire congregation in order to rise together to a higher state of mind and heart, would only disrupt the inner experience of prayer.
Just as the sages have applied this ruling to negative emotions- e.g., if one hates another person in the congregation, for whatever reason, he ought to pray in a different synagogue-they likewise applied it to positive emotions such as love, affection, or mutual interest, when these distract the worshipper from the feelings he should be experiencing in prayer.
–Rabbi Adin Steinsaltz