Without going into Thomistic philosophy, I will just say that Thomas taught that each act may be evaluated based on its "end," its ultimate purpose or goal. The worthier the end, the worthier the act that leads to it. The goal of all religious life is to follow Christ more closely. Active orders have typically emphasized his external works—preaching, teaching, healing—while contemplative orders focus on emulating his prayer and self-sacrifice, his direct communion with the Father.
Since God is the direct "end" of the contemplative life (the apprehension of and intimacy with God), we say it is superior to external works of mercy, which have other ends (education and physical well-being).
Perfectae Caritatis says that monasteries "are entirely ordered toward contemplation, in such wise that their members give themselves over to God alone in solitude and silence, in constant prayer and willing penance" (7).