It appeals to people for various reasons, but think about what kind of stuff rap music tends to talk about: luxury items, women, partying, debauchery, drug culture. If you are a bored white kid in 2003 and see Hey Ya! by Outkast on the TV followed by Mambo Number 5, it seems like nothing but fun.
The real reason it took off is because that's what the music channels decided was the next big thing. Rock music was 50 years old and not really hip anymore. Grunge took a commercially viable genre and gave it the middle finger during the 90s, and Alternative was a wet blanket. "Party Music" used to be something like Motley Crue, something that would get you pumped in some capacity, or at least something uptempo and fun. Rock kind of abandoned that to an extent while black musicians were experimenting with new sounds and styles, which included party anthems and other "have fun" pop music hooks in songs.