How do guys feel about jealousy?

I really like this guy. He usually gives me all the attention over the other girls around. But this one day he didn't and it kind of hurt me in a way because I am very much attracted to him. I know he's strictly looking for a hook-up, so I decided to just move on. So I ended up getting attention from another guy, and we just cuddled and flirted back and forth. I know this guy seen us that night, and my friends said that they thought he was pissed. How come guys can flirt with other girls, but a girl can't flirt with another guy? How do you guys feel when a girl makes you jealous? Does it make you want her more and work harder to get her or do you just give up? Please help, I'm so confused!