dharmam caveksya dharmavit
smaran chukra-vacah kale
raja-putrya—by Sarmistha, who was the daughter of a king; arthitah—being requested; apatye—for a son; dharmam—religious principles; ca—as well as; aveksya—considering; dharma-vit—aware of all religious principles; smaran—remembering; sukra-vacah—the warning of Sukracarya; kale—at the time; distam—circumstantially; eva—indeed; abhyapadyata—accepted (to fulfill the desire of Sarmistha).
When Princess Sarmistha begged King Yayati for a son, the King was certainly aware of the principles of religion, and therefore he agreed to fulfill her desire. Although he remembered the warning of Sukracarya, he thought of this union as the desire of the Supreme, and thus he had sex with Sarmistha.
King Yayati was completely aware of the duty of a ksatriya. When a ksatriya is approached by a woman, he cannot deny her. This is a religious principle. Consequently, when Dharmaraja, Yudhisthira, saw Arjuna unhappy after Arjuna returned from Dvaraka, he asked whether Arjuna had refused a woman who had begged for a son. Although Maharaja Yayati remembered Sukracarya’s warning, he could not refuse Sarmistha. He thought it wise to give her a son, and thus he had sexual intercourse with her after her menstrual period. This kind of lust is not against religious principles. As stated in Bhagavad-gita (7.11), dharmaviruddho bhutesu kamo ’smi: sex life not contrary to the principles of religion is sanctioned by Krsna. Because Sarmistha, the daughter of a king, had begged Yayati for a son, their combination was not lust but an act of religion.
Link to this page: https://prabhupadabooks.com/sb/9/18/32