I guess the actual question is, is there something you want so bad that you would violate your moral code.
Would you kill someone you hate to gain the affection of someone you love?
So what do you want badly and what horrible thing would you do to get it.
There you go. Now I can answer that and not be confused as to what you mean. Your original question made me think of something entirely different, but even then I was not sure exactly what you were asking.
These questions all depend on the situation. I can say that no, I would not violate my moral code to get something I want...but I don't know of anything I want really bad, honestly. Would I kill someone I hate to gain the affection of someone I love? I'm not even sure how doing this would gain me the affection of someone I love. I'm going to say a very definite NO to this one. I would only kill someone if it were in self defense.
I have once violated my moral code that I remember. I felt very bad about it, and still do. I had an ISTP friend I had, had a crush on for years but never acted on it because she had a steady boyfriend the entire time. She invited me to our mutual friend's house to play videogames and have some alcoholic beverages. We had done this before and it remained platonic each time...though our mutual friend had told me on a few occasions that she was acting flirty towards me. I really never noticed it, personally. I'm bad at being able to tell when someone is flirting with me.
Anyway, so I get there and we have some drinks and are playing videogames. I have about 8 shots of jagerbombs or so and decide that I've reached my limit and tell them both I'm done drinking. They say okay and we go back to playing videogames. A few minutes later my ISTP friend comes out with two shots and tells me to stop being a pussy and to take more shots with her. I eventually agree and from that point I'm not sure how many I had. Probably around 15 or so. Way more than I ever have. At this point it's getting late and I'm way too drunk to drive home so my friend says it's cool that I crash there. I go lay down to pass out and a few minutes later an ISTP pops in and starts coming on to me and I didn't stop her. I won't go all TMI but I think you know how it ended.
I was also about 3 months or so into a relationship with my first g/f. Needless to say this was doubly bad according to my morals.