It is forbidden for one praying to seat a baby in front of her, as there is concern that the baby will disturb her kavana (MB 96:4). Certainly during prayer times one may not bring babies and small children who do not know how to pray, since they are likely to distract the people praying.
If one brings a child to prayer services and the child begins to disrupt the congregation’s prayers, he must take the child out of the synagogue, even if it means he must interrupt his Amida, and continue praying outside. This applies to women in the women’s section as well (see above, 14:2).
Although there is a pious custom to bring babies to the synagogue so that they can absorb its holy atmosphere, the custom applies specifically to times when prayer services are not being held. In order to emphasize the importance of this matter, I will cite Shlah, which states in the name of Orĥot Ĥayim:
Children’s chatter in synagogue is a severe prohibition. Nowadays young children come to the synagogue to bring punishment upon those who bring them there, for they come to desecrate the sanctity of our God’s house and to laugh in it as they do in city streets. They get up to play with one another; this one plays with that one and that one hits the other. One rejoices, another cries. One talks, another shouts. One runs here, the other, there. One relieves himself in the synagogue and everyone screams, ‘Water, water!’ Another one is given a book by his father, which he throws on the floor or tears it into twelve pieces. Ultimately, the noise of their shenanigans destroys the kavana of the worshippers and causes the desecration of God’s name. One who brings children to synagogue in this way should not expect reward, but punishment. The worst thing is that these children will be raised on this bad custom and foreign habit. As they grow older, they will increase their contempt for the synagogue and its sanctity and they will show no respect for the Torah, since once one becomes habituated to a sin, it becomes permitted to him, and even as he ages, he will not abandon it. In conclusion, it is proper for one not to bring very small children to synagogue, because he will [only] lose from it and not gain. However, when the child reaches the age of education, on the contrary; the father should bring the child to synagogue, teach him to sit in awe and reverence, not let him move from his seat, and encourage him to answer “amen” and respond to Kaddish and Kedusha (Shlah, Masekhet Tamid Ner Mitzva, brought by MB 98:3).