This is chapter 7 of St. Thomas' book, On the Perfection of the Spiritual Life. (The link takes you to an incomplete translation of the work, but it's still very good.) The book's primary aim is to consider the religious life and priesthood, etc., but much of it can be applied to the ordinary lay Christian as well. In this work, St. Thomas lists three different ways by which one might attain perfection. In this particular passage, he speaks of the first way.
The First Way to Perfection, Which is the Renunciation of Temporal Things
AMONG temporal goods the first we should renounce are external goods, which are called riches, and the Lord counseled this when he said, “If you would be perfect, go, sell what you possess and give to the poor, and you will have treasure in heaven; and come, follow me.” (Matt. 19:21). The utility of this counsel is shown by what follows. The first evidence for this is what in fact happened next. For when the young man who was asking about perfection heard this response, he went away sad. And as St. Jerome says in his commentary on Matthew, “The cause of his sadness is stated: "He had many possessions," which were thorns and thistles that choked the seed of the Lord’s words.” And St. Chrysostom, explaining the same passage, says that, "those who possess little are not hindered in the same way as are those who abound in riches; for the increase of wealth enkindles a greater fire [of desire for wealth], and avarice grows stronger.” St. Augustine, too, says in his letter to Paulinus and Therasia that “we are more firmly fetterd by love for the earthly things that we possess, than by desire for the things we seek; for why did this young man go away sad, except because he had many possessions? For it is one thing not to want to acquire things that we do not have, but quite another to give up the things we already have. For these things may be repudiated as extrinsic to ourselves, but to give up those things we already have is [experience] like giving up the limbs of our body.
The utility of this counsel is secondly manifested by the words the Lord goes on to say, "It will be hard for a rich man to enter the kingdom of heaven." For as St. Jerome says, “It is because it is hard to despise the riches that we have. Our Lord did not say that it is impossible for a rich man to enter the kingdom of heaven, but that it is hard. When he affirms difficulty, he does not indicate that it is impossibile, but shows the rarity of it.” And, as St. Chrysostom says on the Gospel of St. Matthew, the Lord goes further, proving that it is impossible, when he says “It is easier for a camel to pass through the eye of a needle than for a rich man to enter the Kingdom of Heaven.” “From these words,” says St. Augustine, “the disciples understood that all who covet riches are included in the number of the rich; otherwise, since the number of the wealthy is small in comparison with the multitude of the poor, the disciples would not have asked, “Who then can be saved?” (Questions on the Gospel)
From these two sayings of Our Lord it is clearly shown that it it hard for those who have riches to enter into the Kingdom of Heaven. For as the Lord himself says elsewhere, “The cares of this world and the delight in riches choke the word, and it becomes unfruitful” (Matt. 13:22). Indeed it is impossible for those who love riches inordinately to enter heaven, and much more impossible than for a camel to pass through the eye of a needle. For the latter feat is impossible because it is contrary to nature, while the former is impossible because it is contrary to divine justice, which is more powerful than any created nature. From this, then, the reason for this divine counsel becomes evident; for a counsel is given concerning that which is more useful, according to what St. Paul says, “In this matter I give my advice, for this is useful for you” (2 Cor. 8:10). But to attain eternal life, it is more useful to give up riches than to possess them; for those who possess wealth will with difficulty enter the kingdom of heaven, since it is difficult for one's affection not to be bound to the riches that one possesses, which attachment to riches makes it impossible to enter the kingdom of heaven. Therefore the Lord's counsel to renounce riches was a salutary counsel.
But someone might object, against the foregoing, that St. Matthew and Zaccheus had riches, and yet entered the kingdom of heaven. But St. Jerome answers this objection, saying, “We should consider that at the time when they entered, they had ceased to be wealthy.” But Abraham never ceased to be rich; he died a rich man, leaving his riches to his sons, as we read in Genesis. According to what was said he seems not to have been perfect, and yet the Lord said to him, “Be perfect” (Gen. 17:1). This question could not be resolved if the perfection of Christian life consisted in the very renunciation of wealth. For it would follow that no one who possessed riches could be perfect. But if we consider the Lord's words carefully, he does not locate perfection in the very giving up of wealth, but shows that this is a certain way to perfection, as his very way of speaking shows, “If you would be perfect, go, sell all that you possess and give to the poor, and follow me,” indicating that perfection consists in the following of Christ, while the renunciation of riches is a way to perfection. Hence St. Jerome says on the Gospel of St. Matthew, “Since giving up our possessions is not sufficient, Peter adds that wherein perfection consists, when he says, ‘And we have followed you.’” Origen, too, says on the same passage, “The words, ‘if you would be perfect’ are not to be understood as though a man becomes immediately perfect when he has given his goods to the poor, but that from that time, the contemplation of God begins to lead him to all virtues.” It can therefore happen that a rich man is perfect, clinging to God with perfect charity. And in this way Abraham, who possessed riches, was perfect--his soul was not entagled in riches, but was totally united to God. And this is what the words of the Lord spoken to him signify, “Walk before me and be perfect,” showing that his perfection lay in walking before God, and in loving Him completely, even unto the contempt of himself and of all that belonged to him. And he showed this especially in his readiness to sacrifice his son. Hence the Lord said to him, “Because you have done this, and for my sake have not withheld your son, I will bless you” (Gen. 22:16).
But if anyone wants to argue from this that the Lord's counsel about renouncing wealth is useless, because Abraham was perfect, though he possessed riches, the response to him is evident from what has been already said. For the reason the Lord gave this counsel was not because rich men cannot be perfect, or cannot enter the kingdom of heaven, but because they cannot do so easily. The virtue of Abraham was therefore very great, that although he possessed wealth, his soul was detached from wealth. In a similar way Samson's strength was great, since armed only with the jawbone of an ass, he slew many enemies; and yet counsel is not uselessly given to a soldier to take up arms in combat with his foes. Neither, then, is it useless to counsel those who desire perfection to renounce their earthly goods, although Abraham was perfect with all his wealth.
[Practical] conclusions are not to be drawn from wonderful deeds; for the weak are more capable of wondering at and praising such deeds than of imitating them. Hence we read in Sirach 31:8, “Blessed is the rich man who is found without stain, and who has not gone after gold, nor put his trust in money or in treasures.” This passage shows that the rich man who does not contract the stain of sin by the affection for riches, who does not go after gold by covetousness, nor extol himself over others by pride, trusting in his riches, is indeed a man of great virtue, and adhering to God with perfect charity. Hence St. Paul says to Timothy, “Charge the rich of this world not to be high-minded, nor to trust in the uncertainty of riches” (1 Tim. 6:17). But the greater the blessedness and the virtue of rich persons of this kind, the smaller is their number. Hence [the passage of Sirach] continues, “Who is he, and we will praise him? for he has done wonderful things in his life.” For truly he who while abounding in riches has not set his heart upon them has done wonderful things, and if there is such a person, he has without doubt been proven perfect. Hence it continues, “Who has been tried therein,” i.e., as to whether he can live a sinless life while possessing riches, “and found perfect?” as though it were to say: “such a man is rare," and for him "it will merit for him eternal glory,” which is in harmony with the saying of the Lord, that "it is hard for a rich man to enter the kingdom of heaven."
This, then, is the first way for reaching perfection, that someone, out of the desire to follow Christ, renounces riches and chooses poverty.