According to the Nielson TV ratings (as determined by numbers of TVs watching a particular sports on average) ranks as follows:
NFL (National Football League)
NBA (National Basketball Association)
MLB (Major League Baseball)
NCAA football (college football)
NCAA basketball (college basketball)
NASCAR (stock car racing)
WWE (professional wrestling)
NHL (National Hockey League)
AFL (Arena Football League)
WNBA (Women's National Basketball Association)
MLS (Major League Soccer)
IRL (Indy Racing League)
The first half of that I believe, but the second half of that I am sure has to do with availability as much as popularity. I find it hard to believe that AFL or WNBA is more popular than IndyCar or soccer. Ratings are probably what they are due to being carried on networks that don't have the penetration as others. (ESPN carries AFL, or at least did at one point, for example)
Technically, both you and Sigma1914 are correct.
There are many polls out there which clearly shows that the NBA is not nearly as popular as MLB, NHL, or even NASCAR but when it comes to television ratings, The NBA is a definite second.
I'd be highly suspect of those polls, though. Sports are a fickle beast, and you can't just take a random sampling and get a good idea of how they're doing. NBA does really well with urban audiences, NASCAR with more rural and suburban audiences. Comparing some of these things can get kind of tricky.