think the communication from both sides isn't clear enough. He could have told her: "Hee girl (don't know her name), I have a girlfriend at the moment so I would appreciate if you don't flirt with me."
She would continue to talk to him in a normal way or decide to stop texting him because it is to painful.
But apparently he likes the attention from her too much, otherwise he would speak clear language....
People love attention and love to get admiration, so I think he is just too much into admiration from others.