"O happy fault,
O necessary sin of Adam
which gained for us so great a redeemer."
Had it not been for the sin of Adam, we would not have 'needed' or 'necessitated' Jesus Christ. Adam's sin made the need for a savior. Words have developed in meaning - necessary is one such word that in Latin has a variety of meanings as an adjective (in my Latin dictionary, it means "necessary/needed/essential/indispensable; inevitable, fateful; urgent/critical; unavoidable/compulsory")
The Latin of the verse in question is
"O certe necessarium Adae peccatum,
quod Christi morte deletum est!
O felix culpa,
quae talem ac tantum meruit habere Redemptorem!"
Here's my quick translation:
O, certainly inevitable sin of Adam,
which because of Christ's death is abolished!
O happy fault,
which gained [humanity] to have so excellent and so great a Redeemer."
I also found Fr. John Zuhlsdorf's more 'slavishly accurate' translation
O truly needful sin of Adam,
that was blotted out by the death of Christ!
O happy fault,
that merited to have such and so great a Redeemer!
One quick little fact that the word translated as 'gain' is meruit - merit ("earn; deserve/merit/have right; win/gain/incur; earn soldier/whore pay, serve"). It can be used for the payment made to a prostitute - perhaps it is ill-gotten gains, Adam's sin 'meriting" us the Redeemer! But thank God for the Redeemer!
God is omniscient. Before the creation of Adam and Eve, before He spoke the world into existence, He knew what was going to happen. He knew that the one rule ("Do not eat of the fruit of the Tree of Knowledge...") would be violated. He knew that the human experience of His continual call to conversion through the covenants (Noah, Abraham, and Moses) and the prophets would be futile. He knew that humanity could not be allowed into eternity without Christ to open the gates of heaven and His saving action in the World. Yet He had a plan from all eternity for the redemption of humanity to bring them into His presence. When all was ready for the Second Person of the Trinity to enter into time and space, Jesus Christ did so. With His death and resurrection as the Incarnate God, Jesus restores and reconciles man to God, and Heaven is wedded to earth. He gives us more than what was lost - He gives us eternity!
The Resurrection of Christ, and the redemption that He wins for us is so much greater than that for which we could have hoped. The understanding of the Church is that Adam and Eve enjoyed a state of "original justice" before "original sin" - that is, that he enjoyed a natural harmony with God and the rest of creation. With his sin, that harmony was damaged beyond human repair (but not God's, of course) though man still could chose to follow God in this life (still separated from Him in eternity, though not is Hell as a state of torment). All the same, humanity lost earthly paradise. What Christ gives in His incarnation, death, and resurrection, is not the restoration of natural harmony, or Original Justice, or even earthly paradise. He gives supernatural justice, that we can be made perfect and live with God in eternity in heaven. We are given the right to be in the presence of God in Heaven, while Adam only walked with God in paradise!
In this light, we clearly understand that this verse is not a permission slip to 'sin greater' or as Luther said to "sin boldly" mentalities, but a recognition of St. Paul's observation (Romans 5:20), that where sin increased, grace increased all the more. God's loving response is always greater than our sin, because He is perfect. God's perfect love for us means that He would continually call us to holiness even when we sin. God could have been justified on simply allowing us to live and to die, and to spend eternity separated from Him, but He loves us perfectly, and makes us justified through Christ (but we have to respond to it). It is our ability to choose freely to follow God (free will) that makes us human. In Christ, God makes it possible for us to freely choose Him! God so deeply desires us, that He gives the grace to love Him, to follow Him into eternity. Because of Christ, because of His death and resurrection, we receive the call to become saints! All because of Adam's sin!