The Kentucky Wildcats head into the NCAA tournament undefeated and are the huge favorite to win it.

But when it comes to profits, they're also-rans.

The top-earning men's college basketball is actually the Wildcats' in-state rivals, the Louisville Cardinals. That team posted $24 million in profits on revenue of about $40 million during the 2013-2014 school year, based on a CNNMoney analysis of figures filed with the U.S. Department of Education.

While Kentucky has one of the best men's basketball teams, it actually ranks 16th in terms of profitability, with earnings of $7.5 million last year.

That makes them less profitable than the Northwestern Wildcats -- even though Northwestern has never made the NCAA tournament.

The second most profitable team is yet another one named the Wildcats: the University of Arizona, which posted a $17.7 million profit.

Related: Buffett's $1 billion NCAA bet goes bust

Syracuse, which was just hit by NCAA sanctions and won't be going to the tournament this year, was the third most profitable men's basketball team. But Syracuse's standing could drop, since it's been ordered to return an undisclosed amount of money to the NCAA.

Men's college basketball teams earn money selling tickets and merchandise, but the bulk of their profits come from TV deals. Their profitability is helped by the fact that players don't get paid beyond the scholarships they receive.

That's why the profit margins for college basketball are significantly higher than they are for pro teams. In fact, more than a dozen college teams have profit margins above 50%.

A team's profitability has less to do with its performance on the court than which conference it belongs to. That's because most college sports money is distributed through the conferences.

Related: Michael Jordan joins Forbes billionaires' club

For instance, CBS (CBS) and Turner Broadcasting are paying the NCAA $11 billion over 14 years to broadcast the tournament. That money is divided among the teams using a complicated formula that takes into account how many games teams in each conference play. (Turner is the Time Warner (TWX) unit that also includes CNN.)

So even though a school like Northwestern has never been to the NCAA, it still reaps the benefits when its fellow Big Ten teams do.

The conferences also get paid for many of their regular-season game broadcasts, which air on various networks including those dedicated to individual conferences, like the SEC Network and the Pac-12 Networks.

So it's easy for a team in a major conference to make a profit, but for the rest profitability can be a struggle.

Only 123 of the men's programs at Division 1 schools are profitable, and they're mostly from big money conferences. They earned $351 million combined on nearly $1 billion of revenue last year.

But the other 223 teams either broke even or lost money.

Oregon State posted the biggest loss last year: nearly $3 million.