6 But when you pray, go into your private room, shut your door, and pray to your Father who is in secret. And your Father who sees in secret will reward you. (Matthew 6:6 CSB)
Our God sees everything and knows everything. So whether we do good or bad, God is a witness. Additionally, others may be witness to how we display our good and bad behaviors as well. If we are trying to make our good behaviors, like praying, a part of what others witness (for our benefit), then this is actually bad behavior.
This is not to say that all prayer should be done in secret. There are good and right times to pray in public. Especially when that prayer is focused on helping others.
However, it is a good practice to keep the majority of our prayers to ourselves and seek a quiet, private place to pray. Then what we do in secret takes on new meaning. It also gives us a chance to really open up, bearing our soul to God even to the point of weeping without any embarrassment.
Prayer, for the most part, is a private thing that should be given the reverence it deserves and the secrete place where we can be alone with God.