For some reason she decided that you were not the one for her. There are so many reasons why she would keep saying she was in love with you, and happy, when she really wasn't.
1) you must have been pretty good to her, because she didn't want to hurt your feelings
2) because you guys got along, she didn't know HOW to break up with you - she felt guilt. At 17, it can be hard to know how to handle a situation like that..
3) she really wasn't sure what she wanted.. she was confused, or she was hoping that maybe she was just going through some sort of phase, and that everything would be fine in a few days etc..
4) she sees this other guy, and for some reason, she just felt he was a better match for her..
5) perhaps she was scared because you two were getting so serious, and she wants to date more before settling down..
Stop wondering 'why' - there are just too many possibilities, but notice that NONE of the ones I mentioned above have anything to do with you - just because she left you, doesn't make it your fault - people change, people change their minds, and honestly, a lot of the time it doesn't have anything to do with others, it is all about her and her feelings..
I know you must be very upset right now, but do your best not to take this too personally - the past is over, LEARN from the past - Lesson #1 - she made you happy, and so you like being in a relationship - find someone else and you will be happy again.
Lesson #2 - sometimes people leave but that isn't YOUR fault.. you did your best - getting worried about the future (will I find someone else? Will they leave too? etc) solves NOTHING.. don't go there.. If I had a car accident yesterday, does it make any sense that I am going to have another one today? What I mean is, don't think that because one relationship didn't work out, none of them will - I hope you won't think that, because it just isn't true..
By staying positive, you will find someone else. I am sorry for your loss.. try not to move on to someone else too quick.. give yourself some time to build yourself back up..