I suspect that Matthew was writing to a mixed Jewish and Gentile congregation; neither group wanted to accept the other. Each viewed the other as weeds, themselves as wheat. Perhaps the Jewish Christians felt that since they were the sons and daughters of Abraham, surely they were the wheat and the Gentile Christians were an obstacle to their growth. Perhaps the Gentile Christians felt that they were the wheat, with their freedom from old rules and that the Jewish Christians were an obstacle to their growth. If we can't be quite sure who is a weed and who is wheat, we're better off not touching anything.

I am inferring that this conflict between the two groups was pretty serious and destructive. Why else would Matthew include the allegorical interpretation with its dramatic contrast between the fate of the wheat and the fate of the weeds? It underscores the themes of the reward for obedience and the punishment for disobedience found elsewhere in the gospel.

Matthew must feel his congregation needs motivation to be obedient. Some people are motivated by fear, and so he emphasizes that the consequences of not following Jesus' teachings is punishment. Disobedience, self-centered living, and unwillingness to forgive lead to punishment. Jesus wraps up the Sermon on the Mount with an exhortation to be do-ers and not just hearers of Jesus' teachings (7:21). The parable's closing picture is of the evildoers weeping and gnashing their teeth (13:42).

Other people are motivated by the promise of reward, and so Matthew emphasizes that obedience leads to reward (Mt. 5:12; 6:2-4; 25:1-30, 31-46). I noticed, in looking at a concordance, that Matthew mentions the rewards of righteousness four times more often than Luke. The parable ends by promising that the righteous will "shine like the sun in the kingdom of their Father" (13:43).

For both groups in his community, Jewish Christians and Gentiles, the temptation is to try to get by on lip service without putting one's life on the line. The motivation for this ploy differs, but the result is the same: inactivity. Jewish Christians were resting on the laurels of their heritage, feeling they didn't need to do much. Gentile Christians were reveling in their freedom from the law, feeling they didn't need to do much. Matthew's Jesus calls Jewish and Gentile Christians alike to a righteousness that exceeds that of the scribes and Pharisees (5:20).

So perhaps the parable is an attempt by Matthew to answer the question: How do you motivate people who enthusiastically call Jesus "Lord, Lord," but refuse to follow his ethical teachings (7:21-27; 13:47-50; 22:11-14)?

Perhaps it's his attempt to answer the question: How are two groups to coexist productively and peacefully when each refuses to forbear and forgive the other, but instead excuses their own behavior while judging that of others?

It can't be a coincidence that Matthew's gospel, along with its insistence on active obedience to Jesus, also highlights the need for compassion and forgiveness. Matthew's is the only gospel to include the parable of the Unmerciful Servant (Mt 18:23-24). Our unwillingness to forgive others blocks our ability to receive divine forgiveness.

Says commentator Donald Senior, 

This parable urges restraint and tolerance on the part of the community, a stance that harmonizes with Matthew's strong emphasis on not judging and on seeking reconciliation, even with an enemy (5:21-26, 43-48; 7:1-5). God, not human agency, will deal in a decisive way with iniquity. In the meantime, the community should be aware of evil in its midst but not be compelled to uproot or destroy it. (Senior, 153)