Because it's a show of love and devotion. If you go to church or pray in public, then there are many eyes to see and observe what you do. However, if you pray in private then there can be no doubt that you are doing it solely because of your love for the LORD and your devotion to him. Publicly, in some situations, when you pray, the focus may not always be placed on the LORD directly.