Religious warfare, on the other hand, that is to say, the waging of war in defense of the Catholic Faith, of the Catholic Church, and of the innocent,
is a fitting end for which it is possible that a religious Order should be instituted, with this as its proper scope and aim. This is the judgment of St. Thomas Aquinas, and his judgment is confirmed by the practice of the Church. Military Orders, recognized and approved as religious Orders, have for many ages existed in the Church, in fact, from the time of Urban II. The vow of chastity is most excellently adapted to the end of a military Order. The obligations of a husband and father and the burdens of matrimony stand greatly in the way of freedom to expose one s life to the perils of war without solicitude for wife or children.Supposing celibacy, consecration of chastity to God by vow is itself most well-pleasing to God, and it avails to obtain from Him the protection which is so specially necessary in so perilous a life. The same or similar advantages are to be found in a vow of poverty. In order that a man may truly and from his heart consecrate himself to military service for the sake of God, and seek therein no temporal gain, there cannot be any better disposition than that of his renouncing all temporal things, and laying aside all affection for them. Otherwise there might often be great danger of his fighting rather in order to the increase of his fortune than for the sake of his Maker.
Link (here) to the portion of the book