Because cities and counties and state are willing to. A team would either have to be a part of the public corporation or at the very least pay them reasonable rent. Neither of which happens when it’s a government building. It’s just good business.
I agree that it’s good business for the team. But it’s horribly unfair to taxpayers many of whom can’t even afford to go to the games. Around here the argument that “the whole county benefits from the money the team brings in” is laughable.