It depends on whether other schools have basketball programs. You have sports teams because it attracts some students. Some want that experience. Others want a really amazing gym on campus...so you build one. Others want lots of good food options, so you add that. Others want dorms with suites rather than communal bathrooms, so you build that. These schools spend billions on things that are outside of the educational experience, so they can attract more applications and as that boosts their competitive ranking and prestige, then they can charge more. It's a cycle that drives up cost.
But very few schools make any money off athletics. Most of the P5 lose money. The idea that there is some profit that these players generate and which they aren't earning, that's a myth. Yes the coaches are well paid. Because the coaches are there longer than the players, recruit the players so have many times the impact on the program that any player could. I would guess that 99.5% of all D1 scholarship athletes are overcompensated.