Thomas held several heretical beliefs, some of which were heretical prior to his birth (ex: Pelagianism) and some of which were heresy only after his death (ex: denial of the Immaculate Conception).
Further proof that it is not a "given" that St Thomas Aquinas denied the Immaculate Conception, is found in the following survey of the opinions of theologians on this question, from Volume VI, "Mariology", of Pohle-Preuss, Dogmatic Theology (12 volumes) Herder 1953, page 67:
"5. The Teaching of St Thomas --- Theologians are divided in their opinion as to what was the mind of St Thomas in regard to the Immaculate Conception. Some frankly admit that he opposed what in his day was not yet a defined dogma, but insist that he virtually admitted what he formally denied. Others claim that the Angelic Doctor expressly defended the Immaculate Conception and that the (about fifteen) adverse passages quoted from his writings must be regarded as later interpolations. Between these two extremes stand two other groups of theologians, one of which holds that St Thomas was undecided in his attitude towards the Immaculate Conception, while the other merely maintains the impossibility of proving that he opposed it."
Full article here:
http://www.sedevacantist.net/stthomas/StThomas&IC.htm