God created man for a purpose, namely to "know Him, to love Him, and to serve Him in this world, and to be happy with Him for ever in heaven." To this end, sin plays no part. God did not create man to sin. Certainly God gave man free will. With our will we can choose good or what we perceive to be a "good"; so it is possible for us (albeit insane) to choose sin over God. Thus the materialists twist freedom into a matter of choosing whatever one desires. In reality, choosing God and fulfilling our purpose is to choose freedom. Choosing sin on the other hand is an abuse of freedom.
Man's God given rights, the "natural rights", are those that assist man with his created purpose. Sin plays no role in assisting man towards his goal. While man is capable of sin, it is never his right to sin.
Sin is nothing else than a morally bad act (St. Thomas, "De malo", 7:3), an act not in accord with reason informed by the Divine law. God has endowed us with reason and free-will, and a sense of responsibility; He has made us subject to His law, which is known to us by the dictates of conscience, and our acts must conform with these dictates, otherwise we sin (Romans 14:23).
If by "religious liberty" it is meant that man cannot be coerced into religious belief against his conscience by the state, or if it is meant the right of man to hold the Catholic faith, then we can concur with this. The latter is not contradictory as we know that the Catholic Church serves to bring us to God, and thus participating in the Faith is in union with our natural rights. The former is known as religious toleration with an emphasis on the true meaning of the word "tolerance".
If by "religious liberty" it is meant as a right of man to choose any religion, dogma, belief, etc., that is contrary to God, then it should be obvious that man has no such right. Often the phrase "Religious Liberty" is used when what is intended is "freedom (meaning right) to worship how we choose (including that which is contrary to God)." This might be a "right" granted by the state, but it is no true natural right any more than something like abortion is a right.
...no one is allowed to be remiss in the service due to God, and since the chief duty of all men is to cling to religion in both its reaching and practice-not such religion as they may have a preference for, but the religion which God enjoins, and which certain and most clear marks show to be the only one true religion...
- Leo XIII, Encyclical Immortale Dei (references: 1, 2, 3)
I believe it necessary for one to have a strong grasp on "religious toleration" before one can properly understand the Church on what some call "religious liberty". The Catholic Encyclopedia has a very extensive article on the topic of "Religious Toleration" that deserves study.