Vishwamitra is a unique personality who by the power of his determination and by the approval of Vasishta changed his role from being a fierce Kshatriya King to fiery sage. Interestingly to gain something he had to lose something. This is a principle of life. He lost his kingship and became a sage.
Vishwamitra did great tapa to be promoted to being a sage, but he was tempted by Menaka. He got distracted and through her the great Shakuntla was born, whose character has been poeticised by Kalidas. Vishwamitra muni got some unexpected things as he was swept away by the power of passion.
When Rambha came to distract him, he was determined not be distracted. He was able to tolerate lust but in tolerating lust he lost to anger and cursed the nymph. He conquered lust, but anger the brother of lust conquered Him.
Similarly in life we see, one may conquer poverty but may be conquered by arrogance and sensuality. One may conquer lack of education and be a skilful professional but in doing so he or she may lose the simplicity of appreciating relationships of a family.
This is the nature of the dual world, we lose to gain. Losses and gains are a part of this dual world. Loss and gain without the foundation of dharma are unsustainable. They cannot cooperate with one other. But dharma as a sustainer has the power to harmonise.