It was made DOGMA by one singular denomination, that in 1870. Not by any Council or Synod but simply by a Papal Bull.
I asked that question in my Catholic days..... and was told: "If Mary had sin, then Jesus would have been sinful - and the Bible specifically says He was not." Of course, even as a kid, I realized this means that if Mary's PARENTS were sinful, then Mary could not have been sinless... all the way back to Adam and Eve... and thus we are all sinless. The other reason we were told is that since Jesus was present in Mary, thus by His presence, Mary would be sanctified (retroactively). Of course, even as a kid, I realized that Jesus was present in the whole world and thus by His presence the whole whole would have been sanctified (retroactively) and thus the Cross was entirely unnecessary: He simply had to be present.
As a good Catholic boy, I was taught that GOSSIP is the intentional spreading of something not known to be true (and it's a serious sin). Yet we were taught that it is DOGMA - a matter of highest importance and certainty possible - that Mary was uniquely conceived without original sin. How does the RCC KNOW this? Answer: When the unique, singular RC denomination speaks, ERGO God Himself is speaking. What I was told: "Josiah, if JESUS HIMSELF stood physically in front of you and told you something, would you ask 'is that true' or 'how do you know?" Then how in the world can you ask that of the Catholic Church?" Ah, Catholicism...... really very simple.
.