In Islamic system, the issue of sexual morality comes under the shari'ah, the laws of Islam. Therefore it seems appropriate to explain the sources of the shari'ah from our point of view. The primary sources of the Islamic laws are two things: the Qur'an and the sunnah. By the sunnah, we mean the sayings, actions and silent approval of the Prophet and the Ahlu'l-bayt.
The Qur'an describes only the basic rules of the shari'ah, and the sunnah elaborates upon them. The Qur'an introduces the Prophet of Islam as follows: "He (Allah) raised up among the common people a Messenger from among themselves to recite to them His revelations, to purify them, and to teach them the Book and wisdom;"(62:2) "And We have revealed to you (O Muhammad) the Reminder (i.e., the Qur'an) so that you may clarify to the people what has been revealed to them, and so that they may reflect." (16: 44) These two verses definitely prove that Prophet Muhammad (peace be upon him) was not just a 'mail-man' whose only job was to deliver the Book to us. He was a teacher and a commentator of the Qur'an. Even his actions are a source of guidance for us: "You have a good example in Allah 's Messenger for whosoever hopes for God and the last day, and remembers God oft." (33:21) The obedience tot he Prophet has been considers as the proof of loving Allah: "Say (O Muhammad): 'If you love Allah, then follow me; (if you do so,) Allah will love you and forgive you your sins.'" (3:31) To show the importance of obeying the Prophet, the Qur'an further says, "Whoever obeys the Messenger has surely obeyed Allah." (4:80)
The Muslims who lived during the Prophet's time had easy access to his sunnah. What about use who were born hundreds of years after the Prophet's death? Well, the Muslims of the early days realized the importance of the Prophet's sunnah and started preserving his sayings in books of hadith. Even the actions of the Prophet, observed by the companions, were preserved in writing. But this process of preserving the sunnah of the Prophet was not immune from mistakes and even forgery. Many sayings were invented and wrongfully attributed to the Prophet during the early period of the Islamic history. Therefore, it is absolutely necessary to find an authentic and, at the same time, informed source for the sunnah of the Prophet.
When you look at the Muslims of the Prophet's days, you can find no one who might be more knowledgeable, informed, reliable and closer to the Prophet than the Ahlu'l-bayt, the family of the Prophet. After all, it is the Qur'an which testifies to their spiritual purity of highest category by saying, "Verily Allah intends to purify you, O the Ahlu'l-bayt, a thorough purification." (33:33) Combine this verse about Ahlu'l-bayt's purity with the following: "It is the holy Qur'an in a preserved tablet,, none shall touch it but the purified ones." (56:79) This shows that the Ahlu'l-bayt could understand the Qur'an better than any other follower of Prophet Muhammad (peace be upon him). Allay says, "Say (O Muhammad), 'I do not ask from you any reward (for bringing the message to you) except to love my near ones.'" (42:23) See that it is Allah who is commanding His messenger to ask the people to love his family. If they were not truthful, reliable, and worthy of following, would Allah command us to love them?
These few verses are enough to show that the best commentators of the Qur'an and the most authentic source for the Prophet's sunnah are the Imams of Ahlu'l-bayt. The Prophet himself said, "I am leaving among you two worthy things. As long as you hold on to them both, you will never be led astray after me. One of these two is greater than the other: the Book of Allah (which is a rope hanging from the heaven to the earth) and my descendants, my Ahlu'l-bayt. These two things will not separate from each other until they come to me at the (fountain of) Kauthar (in the hereafter). Therefore, see how you recompense me by the way you deal with them."
This is not the place to discuss about the authenticity of the above hadith, but it will suffice to quote Ibn Hajar al-Makki, a famous anti-Shi'ah polemicist. After recording this hadith from various companions who had heard it from the Prophet at various places and times, Ibn Hajar says, "And there is no contradiction in this [numerous reports] since there was nothing to prevent the Prophet from repeating [this statement] at those various places because of the importance of the holy Book and the pure Family." (Ibn Hajar al-Makki, as-Sawa'iqu 'l-Muhriqah, chapter 11 section 1. Also see S. Saeed Akhtar Rizvi, Imamat, Sharafu 'd-Din al-Musawi, The Right Path, and S.M.H. Jafri, The Origin and Early Development of Shi'a Islam.)
We can conclude from these verses and the hadith mentioned above that the Ahlu'l-bayt are the most authentic and the best source for the sunnah, and therefore we prefer them to all other sources. Whenever we quote a hadith from the Imams of Ahlu'l-bayt, it is not actually from themselves, instead it is the hadith of the Prophet which they have preserved as the true successors of the last messenger of God. Imam Ja'far as-Sadiq (a.s.) says: "My hadith is the hadith of my father, the hadith of my father is that of my grandfather, the hadith of my grandfather is that of al-Husayn [bin 'Ali], the hadith of al-Husayn is that of al-Hasan [bin 'Ali], the hadith of al-Hasan is that of Amiru 'l-mu'mimin ['Ali bin Abi Talib] (a.s.), the hadith of Amiru'l-mu'minin is that of the Messenger of Allah (s.a.w), and the hadith of the Messenger is a statement of Allah, the Almighty, the Great." (In Shi'ah sources, see al-Kulayni, Usulu 'l-Kafi, book 2 chapter 17, hadith No. 14; in Sunni sources, see ash-Sha'rani, at-Tabaqatu 'l-Kubra, vol. 1, p. 28; Abu Nu'aym, Hilyatu 'l-Awliya', vol. 3. p. 193, 197.)
Ijtihad & Taqlid: After the twelfth Imam al-Mahdi (a.s.) went into occultation, the responsibility of guiding the Shi'ahs in the shari'ah matters came upon the mujtahids, the religious scholars specializing in Islamic laws. The mujtahids derive the Islamic laws from the two sources mentioned above. This may sound very simple, but it is not so. They do not just open the Qur'an and the books of hadith, and start giving fatwas . They must first of all come up with a methodology of ijtihad (discussed in a subject known as usulu 'l-fiqh).
In their methodology, the mujtahids decide how to study the Qur'anic verses and the ahadith. Should they take the literal meanings only? Have they to find out which verse came first and which came second on the same issue? Will the latter verse abrogate the former, or will it just put some limitations on it? Is every hadith to be considered authentic? If not, what are the means of verifying the authenticity of a given hadith? If they come up on two authentic but contradictory ahadith on a single issue, what recourse should be followed? All such problems have to be solved while designing the methodology of ijtihad, and only then can a mujtahid correctly and responsibly derive a law from the Qur'an and the sunnah.
It is obvious that not all have the ability or the time to specialize in the shari'ah laws; and therefore, for such people it is necessary to follow a mujtahid in the matters of shari'ah. This "following" is known as taqlid.