In the first half of Matthew 6 there seems to be a theme, which is "Don't be like the hypocrites".
In verse 2 Do not sound a trumpet as the hypocrites ( before they give money) that they may have glory of men
In verse 5 Do not be as the hypocrite (for they love to pray standing in the synagogues) that they may be seen of men.
In verse 16 Be not as the hypocrite when you fast (for they disfigure their faces) that they may appear unto men to fast.
It seems that the real issue here is that there were some people who did things hoping to get recognition from other people. If they got that recognition, then that was the reward they were seeking. They were being admonished to seek to be rewarded by God, not men. Even though the example of the hypocrite praying in public was used, I don't believe the Lord intended to ban prayers in a meeting of believers. Such prayers are recorded in Acts.
-- Tim Plear