In the preceding section Christ answered his opponents; now he uses the presence of his mother and brothers as an occasion for commending the disciples who believed.
First, their presence is noted; secondly, the disciples are commended (v. 48).
He says, therefore, While he was still speaking. Here one might ask why it is that in Luke (8:19), where the same words as Matthew's are presented, the words that follow in Matthew are not mentioned; rather Luke (12:27) continues with: "As he said this, a woman in the crowd raised her voice..." So there seems to be a difficulty. Augustine answers: The...re is no doubt that this event occurred, as Matthew says, while he was yet speaking. But it is possible that both what Luke says and what Matthew says happened; it is also possible that Luke is anticipating or is presenting events in the order he recalls.
Behold, his mother and his brothers stood outside... There is no doubt but that the mother is the person mentioned in ch. 1; but there can be question about the brothers. And because brothers are mentioned, it gave occasion to the heresy that after the virgin gave birth to Jesus, Joseph knew Mary and begot sons of her. This is heretical, because after bearing Christ she remained an immaculate virgin. Another opinion was that these were Joseph's children by another wife. But this is nothing, because we believe that Joseph was a virgin, as the mother of Jesus was, because he entrusted the Virgin to a virgin; and as at the end, so also in the beginning. Who, then, are those brothers? Jerome says that men are called brothers in many ways. Some are brothers by nature, as above (ch. 1): "Jacob was the father of Judah and his brothers." Sometimes members of the same race are called brothers: "You may not put a foreigner over you, who is not your brother" (Dt 17:15); sometimes by reason of religion, as all Christians (below 23:8). And upon this rests the custom of calling all members of the same religious order brothers. Sometimes men born of a common ancestor, as in Joshua (2:12): "Give me a sure sign that you will save alive my father and mother, my brothers and sisters." Sometimes all men, because they come from one father, namely, God: "Have we not all one father? Has not one God created us? Why then are we faithless to one another?" (Mal 2:10). In none of these ways are they called brothers of the Lord here; therefore, some are called brothers in another way, namely, because of blood-relationship. Hence in Genesis (13:8) Abraham said to Lot: "For we are brothers," although Lot was his nephew. So, they were brothers, because they were cousins of the Lord.
Source: Commentary on Matthew