It’s one of the unacknowledged laws of parenthood. If the parents tell them not to do something, the kids will likely find it interesting. It can apply to authority figures in general, not just parents. It’s about being contrary in response to being told what to do.
The Dora Zockman Principle can explain many things. The popularity of hair metal, for example. Shock jocks. How many times in a movie or TV show has the condemnation of something by some up-tight fuddy-duddy only confirmed its popularity? I’ll leave it to you, dear readers, to come up with your own examples.