“Regarding James, it should be known that he was the Bishop of Jerusalem and named James the Less, because he had been called after another James. Many things are recorded of him in Acts (15:13). He also wrote a canonical epistle. Now there are various explanations why he is called the brother of the Lord. Elvidius says that it was because he was the son of the Blessed Virgin. For according to him, the Blessed Virgin conceived and gave birth to Christ, and after the birth of Christ she conceived of Joseph and brought forth other sons. But this error is condemned and refuted. Furthermore, it is false for the simple reason that James was not the son of Joseph but of Alpheus.
Others say that before the Blessed Virgin, Joseph had another wife of whom he had James and other children, and that after she died, he took unto wife the Blessed Virgin, from whom Christ was born, although she was not known by Joseph, but, as it is said in the Gospel, He was conceived by the Holy Spirit. But because progeny are named after their father, and Joseph was considered the father of Christ, for that reason, James, too, although he was not the son of the Virgin, was nevertheless called the brother of the Lord. But this is false, because if the Lord did not want as mother anyone but a virgin entrusted to the care of a virgin, how would He have allowed her husband not to be a virgin and still endure it?
Therefore others say (and this is mentioned in a Gloss) that James was the son of Mary of Cleophas, who was a sister of the Virgin. For they say that Anne, the mother of the Blessed Virgin, first married Joachim, of whom was born Mary, the mother of the Lord; but when Joachim died, she married Joachim’s brother, Cleophas, from whom she bore Mary of Cleophas, and from her were born James the Less, Jude and Simon. Then after Cleophas died, she married a third man who was called Salome, of whom she conceived and bore another Mary, called Salome, from whom were born James the Great and his brother John.
But this opinion is denied on two counts by Jerome: first of all, because Salome is not a man’s name, as is plain in Greek, but the name of the woman who was the sister of the Blessed Virgin and who begot James the Great and John, of Zebedee, just as Mary Cleophas begot James the Less, Jude and Simon, of Alpheus. Now this James is singled out from his other brothers and called the brother of the Lord for two reasons: first, because of a likeness in appearance, for he had a facial resemblance to Christ; and because of a likeness in their lives, for he imitated the manners of Christ. Or he is called the brother of Christ, because Alpheus, his father, was related to Joseph. Accordingly, because the Jews were accustomed to draw up the lines of ancestry on the father’s side, and Christ was considered the son of Joseph, as is said in Luke (3:23), he, rather than the others, was called the brother of the Lord, because they were related to Him only on His mother’s side.
Furthermore, ‘brother’ is taken here in the sense of kinsman. For in the Scriptures some are called brothers, who are so by nature: ‘Jacob begot Judas and his brethren’ (Mt. 1:2). Others, who are kinsmen, such as blood relations, are brothers: ‘Let there be no quarrel, I beseech thee, between me and thee…for we are brethren’ (Gen. 13:8). Others who are so by race; hence all who speak the same tongue are called brothers: ‘Thou mayest not make a man of another nation king, that is not thy brother’ (Deut. 17:15). Others who are so by affection; hence all who are friends and who have the same love are called brothers: ‘Because I found not Titus my brother’ (2 Cor. 2:13). Others who are so by religion; hence all Christians who have one rule of life are called brothers: ‘For one is your master; and all you are brethren’ (Mt. 23:8); ‘Behold how good and how pleasant it is for brethren to dwell together in unity’ (Ps. 132:1). And in general, all men are called brothers, because they are ruled and protected by one God: ‘Have we not all one father?’ (Mal. 2:10).”
-St. Thomas Aquinas, Commentary on Galatians.