I am late to this conversation, but I would like to say that your daughter did nothing wrong (she’s 12 ffs) and the other mother’s behaviour is really, really awful.
In the first place she should not have allowed a situation in which one little girl in a dance group was excluded when she must have known that the sleepover would inevitably have been talked about excitedly at the class. I would not have allowed this in the first place.
When she was put on the spot, she obviously knew she had been in the wrong and agreed the child could come - quite right. Your daughter’s request was perfectly natural - she’s a little girl, and, of course, she wanted to join in the fun.
No doubt on the way home the other child complained to the other mother, and the other mother gave in. That was very wrong of her.
If this had been my child, although I think I would not have allowed the situation to arise in the first place, given that it had, I would have told the hosting girl that not only was the other child coming to the party, but if I heard even the slightest hint that my daughter had not been a good host, and included the other girl and made her feel welcome, then there would be serious consequences.
Later, returning to the initially excluded child, the OP’s daughter, it might be worth having a chat to her about how she wouldn’t necessarily be invited everywhere all the time, and although it could be hurtful, it wasn’t always polite to ask if she could come too, because maybe there just wasn’t room for everyone etc etc.
Children aren’t born understanding manners and social nuances. It’s the job of adults to teach them - gently.
tldr; the other mother behaved badly. YANBU.