Thirdly, one may grieve over another's good [aliquis tristatur de bono alterius], because he who happens to have that good is unworthy of it. Such sorrow as this cannot be occasioned by virtuous goods, which make a man righteous, but, as the Philosopher states, is about riches, and those things which can accrue to the worthy and the unworthy; and he calls this sorrow nemesis, saying that it belongs to good morals [pertinet ad bonos mores]. But he says this because he considered temporal goods in themselves, in so far as they may seem great to those who look not to eternal goods: whereas, according to the teaching of faith, temporal goods that accrue to those who are unworthy, are so disposed according to God's just ordinance [ex iusta Dei ordinatione disponuntur], either for the correction of those men, or for their condemnation, [vel ad eorum correctionem vel ad eorum damnationem] and such goods are as nothing in comparison with the goods to come, which are prepared for good men. Wherefore sorrow of this kind is forbidden in Holy Writ.
Summa Theologiae II-II.36.2. The idea seems to be that Aristotle would be right in thinking that nemesis belongs ad bonos mores, if he had a correct conception of human good; he was misled by appearances. This would be consistent with what seems to have been the standard view, found in Boethius, for instance, that while temporal goods like money may accrue by chance in the hands of the unworthy, in the bigger picture of divine providence one finds that this very fact is the beginning of either a punishment that either corrects or destroys the unworthy. As Boethius paradoxically puts it, all fortune, whatever it may be, is good fortune to the just and bad fortune to the unjust. On such a view nemesis is always out of place because the facts that would be required for it to be good never in fact obtain. But in light of other things St. Thomas says one might also read it as saying that while nemesis is a passion everyone experiences, on its own it is defective in such a way that Christians are required not to indulge in it but rein it in by the virtue of mercy (misericordia), which looks at matters in light of divine things. Perhaps there is a distinction of sense that would clarify matters; it may well be that 'nemesis', like 'pity', can refer to different things depending on whether we are talking about the intellectual or sensitive appetite.