Freedomis the freedom to do good, not the license to do evil. Even in sexual ethics, we do have to respect the normal course and result of the love between man and woman, which is life, a new human life with basic rights. These basic rights are life, liberty and property.
That is why, the Church following the precept of Jesus, decrees that sexual relationships are only to be done within legitimate marriage. Why? Because it is the normal fruit of such sexual relations to have the possibility of birth of a new life. Outside marriage such use of sex is considered gravely sinful. You can see why, because such acts may originate new life, human life possessing fundamental rights. For example, children have rights to be nurtured and educated. Life is sacred. You have only one life for which you will answer before God for the things you do.
In a message to the US Bishops, Pope John Paul II truly said: "Describing the sexual union between husband and wife as a special expression of their covenant of love, you have correctly said: The sexual relationship is a human and moral good only within the sphere of marriage: outside marriage it is immoral."