"God blesses those who are persecuted for doing right, for the kingdom of heaven is theirs."
We would hope that doing what's right would be accepted, perhaps even rewarded. Often this is the case. If we do what's legally right, we'll avoid getting into trouble with the government. If we go out of our way to help someone in need, odds are that person will be grateful. Sometimes we'll even receive public recognition for our good works.
But Jesus knew that doing right would sometimes be a cause for persecution. In the first centuries after his death, followers of Jesus who refused to renounce him and worship Caesar were routinely martyred. Today, Christians who speak openly of Christ in some Islamic societies risk capital punishment. In China, believers who gather in the name of Christ might very well be incarcerated.
Even in our society, where Christian discipleship is legal, one who puts Jesus first may be at risk of negative consequences. For example, I know a business executive who, as a Christian, treated even the lowest subordinates in his company with respect and kindness. When his boss criticized him for being too friendly with a janitor, but the executive didn't alter his behavior, it became obvious that his opportunities for advancement in the company had been lost. Or, to cite another example, I have friends who refused to have their son practice with his sports team during Sunday school. Before long, both my friends and their son were blackballed by the coach and mistreated by parents of other players.
This sort of reality can be true even within families. When an adult child finally speaks the truth and says to her family, "Dad is an alcoholic," often the family circles around Dad and rejects the truth-teller.
Jesus holds out hope to all who are treated poorly as a result of their faithfulness as a disciple. Though they might suffer in this world, the kingdom of heaven is theirs, both now and in the world to come. They will experience the joy of knowing God and his pleasure in this life, not to mention the inexplicable delights of the future kingdom.