I can't answer either way. First, you probably hurt her, and that's a bad thing. Second, you left her solely for someone prettier. Rebuttal to point 2: that's not necessarily a bad thing if no one was hurt.Third, no one can say what you did was "right." At best, what you did was morally gray.
Now, since this is a forum, my personal bias. You do not specify if sex was involved, but it can be assumed. That being said, I find it morally repugnant when someone is just fine with casually leaving someone you convinced to give you the most personal thing that can be given.
I say I cannot decide simply because I acknowledge I don't have the whole story.
EDIT: it seems I have to clarify, or I'm going to keep getting quoted as a sexual bigot.
It is my personal belief that while some emotional pain can inadvertently do some good on occasion, causing it is generally a bad thing unless there is something better to be gained from it. When I say what was done is not "right," I mean that it is never right to hurt someone. What is done is done, if you're happier then that is a good thing. What I'm thinking of here, and what everyone seems to ignore, is there's still a girl in this picture, and she was hurt by the OP (unless she was fine with it, in which case OP should've specified). I don't know if there was cheating involved, and if there was, I condemn it. As for my incredibly controversial views on sexuality, I do not mean to say in any way that I am the moral ruler to measure yourselves to. Waht I am saying is that, as promiscuous as some of us can be, to most uf us (disproportionally female but still male-prevalent) still attach a lot of emotional meaning to sex. When a couple is truly in love, sex is a valuable gift to each other. That is why infidelity causes so much pain even now, that's why people kill themselves over cheating now more than ever. Infidelity has become societally okay, but loyalty to our mates hasn't been bred out of the species entirely yet. Sure, an entirely sexual relationship can be casual. But a loving relationship that becomes sexual attaches powerful emotions to sex. It is my worry that the OP leaving was not consentual, and that OP's girlfriend was deeply hurt. I am not saying that leaving an unhappy relationship is a bad thing, I'm saying hurting her was a bad thing, if indeed she was hurt. I'm not saying he shouldn't have left, and if he's happier, more power to him. But even if what he did was not overall bad, having hurt someone, it cannot be good either.