In my (admittedly very limited) experience, Teams was almost free when you're already paying for microsoft 365. At least last time I had any involvement with it, the price difference between having teams in the bundle or not was negligible. It makes it cheaper than any competitor.
Now in reality, I think the true cost is hidden by the frustration it causes (some?) users, but it's very hard to quantify that in a dollar amount. Which is why companies stick with Teams.
The hidden cost is also the removal of competition. Google get more heat for browser "monopoly" when they even provide a free browser base for others to customise, and Microsoft gets almost none for incredibly overwhelmingly anti-competitive behaviour around lock-in to Office, Teams, Sharepoint, Azure.
Yup. That's because they had actual competition in the space. Throwing a (bad) Slack clone for free was a way of preserving and extending their monopoly.
But you're still paying for it. The costs to build and fund the product still exist, and are still coming out of customer payments. Manipulating their pricing to manipulate their customers doesn't change that.
Now in reality, I think the true cost is hidden by the frustration it causes (some?) users, but it's very hard to quantify that in a dollar amount. Which is why companies stick with Teams.