Writing on the subject of whether the rites of unbelievers ought to be tolerated, St. Thomas says:
Human government is derived from the Divine government, and should imitate it. Now although God is all-powerful and supremely good, nevertheless He allows certain evils to take place in the universe, which He might prevent, lest, without them, greater goods might be forfeited, or greater evils ensue. Accordingly in human government also, those who are in authority, rightly tolerate certain evils, lest certain goods be lost, or certain greater evils be incurred (
ST II-II Q10 A11).
This is a remarkable statement regarding government. It has given me fits trying to decide how to handle it here! St. Thomas doesn't in any way endorse what we call pluralism. There is no hint of a suggestion that "what's true for you" may not be "true for me." No. The truth is the truth at all times. But what he says is that we cannot afford the luxury of supposing that we can build a perfect society without evil. We can't, and we shouldn't try. We shouldn't try because our governments ought to model God's government, and God "allows certain evils to take place" even though he could certainly prevent them.
Why? Because "greater goods might be forfeited, or greater evils ensue." For example, God could prevent us from doing evil, of course, but the good of human free will would be forfeit. Another surprising (well, to me, at any rate) example offered by St. Thomas:
thus Augustine says (De Ordine ii, 4): "If you do away with harlots, the world will be convulsed with lust" (ibid).
Now obviously neither St. Augustine nor Aquinas is endorsing prostitution, nor suggesting that adultery and fornication aren't mortal sin. But they are saying that rulers need to exercise wisdom and prudence in their legislation, so that they don't make the world a worse place while supposing that they're making it a better. So how does this principle apply with regard to matters of religion?
Hence, though unbelievers sin in their rites, they may be tolerated, either on account of some good that ensues therefrom, or because of some evil avoided. Thus from the fact that the Jews observe their rites, which, of old, foreshadowed the truth of the faith which we hold, there follows this good--that our very enemies bear witness to our faith, and that our faith is represented in a figure, so to speak. For this reason they are tolerated in the observance of their rites (ibid).
Okay, but that has to do with the Jewish religion specifically. What about others?
On the other hand, the rites of other unbelievers, which are neither truthful nor profitable are by no means to be tolerated, except perchance in order to avoid an evil, e.g. the scandal or disturbance that might ensue, or some hindrance to the salvation of those who if they were unmolested might gradually be converted to the faith. For this reason the Church, at times, has tolerated the rites even of heretics and pagans, when unbelievers were very numerous.
Aquinas says that when it's wiser - for the sake of avoiding an evil - to tolerate error, this should be done, and that the Church has done this at times.
It's clear then that Aquinas viewed the question of religious toleration as a prudential one, and it was a course which the Church had followed more than once. The point is that Aquinas considered doing so to be a wise thing when necessary.