How was the Virgin Mary turned into a goddess?

As a teenager, I went to confession at our local Roman Catholic church and struggled to find much to confess. From the back of my mind, I dredged up some petty misdemeanours and was told by the priest in the confessional box to recite three Our Fathers, Three Glory Be s, and Three Hail Marys. The...