Sometimes you just have to go with the zany nature of the sitcom. The same way Julia Roberts is essentially playing a douchebag in "My Best Friend's Wedding." Ditto, Patrick Dempsey in "Made of Honor."
In all three examples, people are doing things that in real life would be horrible things to do, and nobody would think are funny or endearing. And yet, people love those movies. It's part and parcel for the genre, and How I Met Your Mother
is undeniably the rom-com of TV, so it's not surprising to me that it suffers from the same problem.
But to get back to the example you cite from "Not Yet" -- In real life, yes, that would be a pretty horrific thing to do to your friend. And its worth pointing out too that Ted was pretty offended by both of them in that episode having made that bet.
Then again, look at a character like Barney. Almost every episode features him saying or doing something morally reprehensible or at the very least objectionable. Why is it that Lily is so much more deserving of your disdain?