You shouldn't sleep with someone who's married.
Shawn is drinking with  Jim and Jamie who are married, and Jim passed out drunk while Jamie is being flirtatious with him.
Shawn wants to respond to Jamie's advances.
Shawn tells Jamie it's just the alcohol talking and decides to walk home.
Shawn figures that Jim will never find out and flirts back with Jamie, and they end up sleeping together.
Because Shawn took himself out of the situation Jamie and him didn't act on impulse and potentially saved her and Jim's marriage.
Jamie feels guilty afterwards and tells Jim who is angry at them both, then cuts off the friendship with Shawn.