God willed the Immaculate Conception. What a beautiful gift he has bestowed on mankind in her!
“God Ineffable — whose ways are mercy and truth, whose will is omnipotence itself, and whose wisdom ‘reaches from end to end mightily, and orders all things sweetly’ — having foreseen from all eternity the lamentable wretchedness of the entire human race which would result from the sin of Adam, decreed, by a plan hidden from the centuries, to complete the first work of his goodness by a mystery yet more wondrously sublime through the Incarnation of the Word. This he decreed in order that man who, contrary to the plan of Divine Mercy had been led into sin by the cunning malice of Satan, should not perish; and in order that what had been lost in the first Adam would be gloriously restored in the Second Adam. From the very beginning, and before time began, the eternal Father chose and prepared for his only-begotten Son a Mother in whom the Son of God would become incarnate and from whom, in the blessed fullness of time, he would be born into this world. Above all creatures did God so loved her that truly in her was the Father well pleased with singular delight. Therefore, far above all the angels and all the saints so wondrously did God endow her with the abundance of all heavenly gifts poured from the treasury of his divinity that this mother, ever absolutely free of all stain of sin, all fair and perfect, would possess that fullness of holy innocence and sanctity than which, under God, one cannot even imagine anything greater, and which, outside of God, no mind can succeed in comprehending fully.
… We declare, pronounce and define that the doctrine which asserts that the Blessed Virgin Mary, from the first moment of her conception, by a singular grace and privilege of almighty God, and in view of the merits of Jesus Christ, Saviour of the human race, was preserved free from every stain of original sin is a doctrine revealed by God and, for this reason, must be firmly and constantly believed by all the faithful” (DS 2803).
Pope Pius IX, Ineffabilis Deus, 1854,
http://www.papalencyclicals.net/pius09/p9ineff.htm