But when you pray, go into your room, close the door and pray to your Father, who is unseen. Then your Father, who sees what is done in secret, will reward you.
You are likely to experience public prayer quite often. Every week you hear it in your church services. At mealtime you and your family may pray aloud. Likewise, you may pray with your children or in a prayer group. There is nothing wrong with public prayer.
The issue that Jesus dealt with was that the religious leaders boasted about their prayers. They made loud and long prayers for show so that others would see how religious they were.
God knows and sees all that is done. No one needs to make a public spectacle out of their prayers. The Pharisees did what they did for show. They were praying to God but their prayers were worthless because they were more interested in the praise and respect from men than they cared about God.
For this reason, Jesus urges private prayers. These prayers are heartfelt because there is no one else there to witness them or judge them. A person who prays in private does so only for God. There is no show about it and neither the length of the prayer nor the words said are important when done privately.
There is nothing wrong with public prayer so long as it is not done for show. Loud and lengthy prayers do not make a good prayer. God responds to prayers from the heart.