It's not hard to see why basketball has one of the youngest fan bases. It's a sport that, more than any other, is especially cut out for the social Internet in terms of highlights and personalities. It's fast, fun to watch and especially conducive to mind-blowing feats of athleticism. Even those who don't care to watch a full game can be impressed with a monster dunk, or the seemingly endless and suspenseful final seconds of a game. And because basketball is played in close proximity to fans, they (and coaches and other support staff) are often a big part of highlights as well. Some of the best clips are only tangentially related to the action.
The NBA is very good at luring younger fans in whatever form that takes (for me in 1991-92, it was sports magazines and Saturday morning shows; today, it's social media). Moreover, basketball has the biggest transcendent stars of any sport — everyone knows Michael Jordan, Kareem Abdul-Jabbar, Shaquille O'Neal, Charles Barkley and LeBron James, even if they can't pick a basketball out of a lineup of hockey pucks. Outsize personalities seem to go with the territory more than with other sports.
My guess is that this lies in part with the NBA's greater willingness to let players express their personalities — at least compared to the NFL, which isn't saying much. (It could also be that basketball simply attracts a different breed of personality than other sports. I don't know.)
Basketball's surging popularity all over the world is an impressive testament to how much the sport resonates with young fans today. In addition to the aforementioned speed and video-clip advantages, it's also a cheap and addictive play, and currently lacks the controversies of other popular sports.
Football (my favorite sport) is under deserved attacks over inaction on head injuries, and its top professional league is plagued by corporate politics and a No Fun policy. Baseball (my tied-for-second-favorite sport with b-ball) has had substance-abuse issues for decades, suffers from a drought of genuine personalities and is too slow for many modern fans. Hockey, though its reach is getting wider, is still an alien sport to the lower half of the continent. All of those issues can be fixed or at least addressed; but for now, basketball, like the baby bear's porridge, is just right.