because that's how humans are. if someone cut themselves over a long period of time as a coping mechanism and as something to "gain control" or "feel something", sometimes when shit hits the fan, no matter how clean they are, it could very much return as a thought to continue doing that because they feel so helpless.
sex addictions are a thing and recklessly having sex is a form of self harm that aligns with cutting. it's not an okay thing but acting like it came out of nowhere or that he didnt IMMEDIATELY push the thought away (look up intrusive thoughts) is really showing a lack of reading comprehension

I wanted to consider the manga, but cheating in any form is when I draw the line. The author is clearly just adding spice to the story, when it was SO unnecessary. The personal matter conflict doesn't justify having thoughts of hooking-up with someone.