Because the university affiliation turns minor league football / basketball into national television and gets people to spend millions of dollars on tickets and merchandise. No one watches the NBA D-league, but they're happy to watch the Tar Heels play. Similarly, no one watches arena ball, but they're happy to fill the stadium and watch Oregon State lose every week.
It also serves as extremely effective advertising for the university. The fact "Bama Bama Bama, Bama Bama Bama Bama, Bama Bama Bama" is a valid sentence on ESPN week in and week out adds up to weeks of coast-to-coast advertising for Alabama, and enrollment statistics reflect.