St. Thomas did oppose the Immaculate Conception in his Summa Theologica. From the CE article on the Immaculate Conception (
Source):
St. Thomas at first pronounced in favour of the doctrine in his treatise on the “Sentences” (in I. Sent. c. 44, q. I ad 3), yet in his “Summa Theologica” he concluded against it. Much discussion has arisen as to whether St. Thomas did or did not deny that the Blessed Virgin was immaculate at the instant of her animation, and learned books have been written to vindicate him from having actually drawn the negative conclusion. Yet it is hard to say that St. Thomas did not require an instant at least, after the animation of Mary, before her sanctification. His great difficulty appears to have arisen from the doubt as to how she could have been redeemed if she had not sinned. This difficulty he raised in no fewer than ten passages in his writings (see, e.g., Summa III:27:2, ad 2). But while St. Thomas thus held back from the essential point of the doctrine, he himself laid down the principles which, after they had been drawn together and worked out, enabled other minds to furnish the true solution of this difficulty from his own premises.
In the thirteenth century the opposition was largely due to a want of clear insight into the subject in dispute. The word “conception” was used in different senses, which had not been separated by careful definition. If St. Thomas, St. Bonaventure, and other theologians had known the doctrine in the sense of the definition of 1854, they would have been its strongest defenders instead of being its opponents.
We may formulate the question discussed by them in two propositions, both of which are against the sense of the dogma of 1854:
– the sanctification of Mary took place before the infusion of the soul into the flesh, so that the immunity of the soul was a consequence of the sanctification of the flesh and there was no liability on the part of the soul to contract original sin. This would approach the opinion of the Damascene concerning the holiness of the active conception.
– The sanctification took place after the infusion of the soul by redemption from the servitude of sin, into which the soul had been drawn by its union with the unsanctified flesh. This form of the thesis excluded an immaculate conception.
The theologians forgot that between sanctification before infusion, and sanctification after infusion, there was a medium: sanctification of the soul at the moment of its infusion. To them the idea seemed strange that what was subsequent in the order of nature could be simultaneous in point of time. Speculatively taken, the soul must be created before it can be infused and sanctified but in reality, the soul is created snd sanctified at the very moment of its infusion into the body. Their principal difficulty was the declaration of St. Paul (Romans 5:12) that all men have sinned in Adam. The purpose of this Pauline declaration, however, is to insist on the need which all men have of redemption by Christ. Our Lady was no exception to this rule. A second difficulty was the silence of the earlier Fathers. But the divines of those times were distinguished not so much for their knowledge of the Fathers or of history, as for their exercise of the power of reasoning. They read the Western Fathers more than those of the Eastern Church, who exhibit in far greater completeness the tradition of the Immaculate Conception. And many works of the Fathers which had then been lost sight of have since been brought to light.