The source you have cited in question is not proper. You should read Rudra Samhita (Yuddha Khanda) (chapter 13 - Chapter 25) of Shiva Mahapurana and/or Uttarakhada (Chapter 3 - Chapter 18) of Padma Purana to know complete story though Chapter 97 of Linga Purana mentions different story.
First of all, it was Jalandhara who started everything. He went into chambers of Parvathi (disguised as Shiva) from middle of the war and droped his semen on seeing beauty of Parvathi. Parvathi Devi knew it was not Shiva and immediately disappeared from place and went to Manasa Lake. There she asked help of Lord Vishnu.
Chapter 23, Rudra Samhita (Yuddha Khanda) of Shiva Purana says:
यावद्ददर्श चार्वङ्गीं पार्वतीं दनुजेश्वरः।
तावत्स वीर्यं मुमुचे
जडाङ्गश्चाभवत्तदा॥४१॥
On looking at the beautiful Parvati, by the lord of Daityas, his semen
fell on the ground and all his limbs became benumbed.
अथ ज्ञात्वा तदा गौरी दानव भयविह्वला।
जगामान्तहिंता वेगात्सा
तदोत्तरमानसम्॥४२॥
Thereafter, when Gauri came to realise, the truth that he was a Daitya
and not Siva, she disappeared from the site and went to northern shore
of the lake Manasa.
पार्वत्यपि महाविष्णु सस्मार मनसा तदा।
तावद्ददर्श तं देवं
सोपविष्टं समीपगम्॥ ४४॥
Then Parvati remembered lord Vishnu mentally and she found at once
that the lord was seated before her.
Jalandhara followed Adharmic path and Vishnu too helped Shiva to establish Dharma by following same path of Jalandhara. Devi Parvathi says
सनत्कुमार उवाच
तच्छुत्वा विष्णुवचनं पुनरप्याह पार्वती।
हृषीकेशं जगन्माता धर्मनीर्तिं सुशिक्षयन्॥४९॥
पार्वत्युवाच
तेनैव दर्शितः पन्था बुध्यस्व त्वं तथैव हि।
तत्स्त्रीपातिव्रतं धर्मं भ्रष्टं कुरु मदाज्ञया॥ ५० ॥
Sanatkumara said, “On hearing the words of Vishnu, Parvati, the mother
of the universe, then desired to teach the policy based on dharma.'
Parvati said, “He himself has shown the path, now that has to be the
way and he should be paid in the same manner. At my command, destroy
the chastity of his wife.
Before Judging this act of Narayana, you should know Narayana is not humanbeing. He is a trimurthi (also Supreme Brahman in Vaishnava philosophies).
As mentioned in this answer, Vedas also describe Him as Supreme Being.
Narayana is the Supreme Reality designated as Brahman. Narayana is the
highest (Self). Narayana is the supreme Light. Narayana is the
infinite Self. [Narayana is the most excellent meditator and
meditation.] Whatsoever there is in this world known through
perception (because of their proximity) or known through report
(because of their distance), all that is pervaded by Narayana within
and without.
Taittariya Aranyaka of Yajurveda 10.13
Vedas extol Him as infinite self. It is ridiculous to say he did that act for sexual pleasure. Pure self or Brahman manifest in different forms such as Vishnu, Shiva and other Devas (from Advaitic perspective). Brahman is beyond human intellect and whatever acts he does are called Leelas. To know more about Leela, read this answer.
Here we can say, this sport or leela is to get cursed by Vrinda, so that He can born as Rama. Vrinda curses Vishnu as follows:
यौ त्वया मायया ख्याती स्वकीयौ दर्शितौ मम।
तावैव राक्षसौ भूत्वा
भार्या तव हरिष्यतः॥ ४४॥
By displaying the two Raksasas to me with your illusion, they would be
turned as the demons in reality and shal kidnap your wife.
त्वं चापि भार्यादुःखातों वने कपिसहायवान्।
भ्रम सर्वेश्वरेणायं
यस्ते शिष्यत्वमागतः॥ ४५ ।।
You, yourself, suffering from the separation of your wife, with the
lord of serpents who is acting as your disciple, will wander in the
forest with him.'
Chapter 24, Rudra Samhita (Yuddha Khanda) of Shiva Purana
For beginners in Hinduism, this leela concept would be difficult to understand. Reading Puranas or other scriptures may help in understanding "Leela"more.
As a sidenote, Stories in Puranas could be allegorical in nature or could be literal. Swami Prabhavananda says the following in his book Spiritual heritage of India,
The word purana literally means ancient, the name being applied to
certain scriptures to mean 'that which lives from of old' or 'that
which is ever new though old'.
K. S. Ramaswami, the Indian scholar, has described Puranas as: '. . .
the Puranas are a vital portion of the scriptures of the Hindus. They
are primarily an extension, amplification and illustration of the
spiritual truths declared in the Vedas. Outsiders may call them
legends like the works of fiction current today. Some insiders too may
regard them as mere illustrative fictions or allegories, or as
relating to yogic realities unconnected with the external material
world. But the bulk of the Hindus and the main body of traditional
opinion attribute to the Puranas a double character, viz. illustrative
value and impressive actuality. They have largely moulded public life,
belief and conduct in our land for thousands of years, and they must
be fully utilized by us ifwe are to realize the truths of the Vedas.
Herein lies their permanent and supreme value to us.'
Altogether there are eighteen Puranas, six devoted to Visnu, six to
Brahma, and six to Siva. All of them are written in verse, and all are
usually attributed to Vyasa, the reputed author of the Mahabharata and
editor of the Vedas. Their date may safely be assigned to the somewhat
uncertain Epic Period.