Could be a separation anxiety issue. Not unusual for them to pee or defecate if they are upset.
Do they "do it for spite"? Cats certainly do. And I don't think they are smarter than dogs. Maybe more vindictive! I have had experiences with Basenjis that make me believe some do, but I would doubt it in a young pup. More likely she is starting to have issues with being left alone and the peeing is a symptom of anxiety. A video camera would tell you a lot! (is she upset when she does it or is she calm and deliberate?)