I wish that you weren't hiding behind the Blue Man, because you sound like a really smart guy. You did the right thing by putting your foot down and refusing to get the tablet for your daughter. It's called being a PARENT, which her mother ( your ex, I presume) obviously ISN'T ABLE, WILLING, or MATURE ENOUGH to do.
Yes, your daughter is spoiled- in fact, she's turned into one heck of a spoiled little BRAT. The next time she mouths off or talks back to you like that, take away all her electronics ( and that means everything- including her phone, computer, etc, etc.) and send her to her room without any dinner. Skipping one meal won't hurt her, and going to bed hungry might just teach her some lessons about not being so selfish. Otherwise, your only alternative when she argues, talks back, or mouths off is to start smacking her one across the mouth every time she does it- which I don't advocate because there is such a fine line between discipline and abuse. That line is easy to cross, and once you do that, it's tough to undo it.
In the future, when your daughter comes to visit you,prepare her room ahead of time. Keep any computer you own OUT OF her bedroom, and in a public area such as the kitchen, so that you can monitor what she does when she's online. Make it clear to her that the computer is to be used for SCHOOL WORK ONLY, and that you WILL BE watching what she's doing at all times while she's using it. You also need to make a rule that all electronic devices must be turned off by 10pm EVERY NIGHT, including on WEEKENDS. Make sure that you follow this rule yourself- turn off your phone, tablet, computer, etc, by 10pm too. This will help your daughter learn to manage her time, because she will know that there are limits to how much of it she has.
Trying to talk to your ex about your daughter's spoiled, selfish behavior is probably not going to get you anywhere, because your ex doesn't see this the same way that you do. I'm sure she probably feels guilty because the two of you aren't together any more, and is trying to make up for that by showering your daughter with all sorts of expensive things. In essence, she's trying to "buy" your daughter's affection and love. That's common with divorced parents. I experienced the same thing with my dad for years after my parents split up. He felt terrible about leaving me and my sister, and for the longest time, he kept showering me with expensive gifts to try to make up for it. But the problem was that I saw through what he was trying to do, and it only annoyed me after awhile. Your daughter may or may not get to a point where she's able to recognize the same behavior in her mother. If so, all to the good for you, because it will mean the end of her spoiled, whiny behavior. But if not, you'll have to be the one who makes the rules and enforces them, at least until your daughter is old enough to be on her own.