Don't confuse cost with price.
The following applies in the US. There is also some difference by field and by university. Generally, though,...
I think $57K sounds a bit high, though it probably includes such things as health insurance. The stipend is set to cover modest living expenses of a student in that locality, recognizing that many are married. Enough for frugal living, but little enough that you want to finish ASAP.
And for almost all doctoral students, a TA or an RA will come with forgiveness of almost all costs. Those costs are borne by the institution or the government that supports it. But a privately funded student will have high cost of tuition. Again, I'd guess $99K is at the top end of the scale, and those are total costs over the multi-year program, not annual costs. And, most students in doctoral programs have a TA or (fewer) an RA. Both provide valuable service to the institution, especially in making the faculty more productive.
But yes, the costs are high, since in some fields the labs are costly and the professors are well paid. Even building maintenance isn't free.
You aren't normally paid for your research. A TA means you assist in teaching (normally) undergraduates. An RA probably means that you assist in someone else's research, though your project might grow out of that. You are paid a stipend, not normally a "salary" (US). The tax implications of that difference might be important, but most likely taxes will be due.