Girls like attention. That's the plain truth. Now first off before I continue, there's something I must establish. In some situations, girls won't like you. AT ALL! Maybe it's because you're ugly, or because you look creepy. Or maybe it's because you smell bad. It doesn't matter - they don't like you. So even if you give them attention, they're not going to like it.
Moving on... we then have situations where the girl is going to like you, but she's not going to be ATTRACTED to you. This is the most common scenario, and it gets a lot of guys. This is the one you've been a victim of. In this situation, a lot of girls WILL take the attention you're giving them and use it... but they won't give you what you want from them - a relationship. Because they aren't actually attracted to you.
The last situation is obviously when the girl is attracted to you. Any attention you do give her in this case is welcome and she is going to love you for it. Good luck finding yourself in this situation.
Here's an article for you: link