Jesus wanted to clearly point out the hypocrisy of his time. He warned against doing good deeds for self-glorification. Doing good so we are glorified by others is vanity, and Jesus said we recieve no blessing from God for doing this. Jesus said not to announce our charities or attract attention to ourselves in that way. At the time, Jesus was deliberately characterizing the actions of the Pharisees, who made a big production over such matters. The outward action does not match the intent of the heart. Giving, in the way that these people gave, was actually selfish. Jesus said, that they certainly recieved the reward they wanted, but what value is it compared to a blessing from God? Giving should be done without the intent of recognition, but for the glory of God, and for all he has done for us. Give in secret, secret enough, that you are not even conscious of it, that is becomes natural to do good, not because you want to impress, because it is God’s will.
Pharisees would pray out in the open, in order to get praise from people, and Jesus rightly called them hypocrites. The problem was the prayer became more of a performance than a prayer. The prayers were long and pointlessly repetitious. Jesus said the praise from men that they were seeking was their reward. Jesus told us to pray in private, and avoid the temptation for self-glorification. That way, praying is just between us and God. There is no need for long repetitious prayers- that is the way the pagans prayed. We have a personal God, a Father in heaven, who already knows what we need. This is not to say there is no place for public prayer, but, it should be genuine.
Jesus taught a prayer as a example of how to pray. This was a corrective action. The prayer is simple, and easy to memorize. It acknowledges God as Father and creator in heave. It recognizes the sacredness of his name. It submits to his will and to the hope of his kingdom. It asks that daily needs be met, but it does not ask for excess. It asks for forgiveness, but only as we have forgiven others. It asks to be kept from temptation and evil. It is not a prayer to a distant god who has no interest in the affairs of humans, but an intimate personal God who is called “Father.” The condition of forgiveness is noteworthy- that we must forgive others. Jesus repeated it, because it is not to be ignored or taken lightly.
Jesus taught not to fast for attention, once again criticizing hypocrisy. As he said of giving and prayer, it was best to offer this sacrifice in secret, so that it was part of the intimate relationship with God.
If you want to know more about prayer, check out this study: Lord, Teach us how to Pray.