A sizable chunk of the endowment likely has legal restrictions that limit how funds can be spent. E.g., they could be earmarked for undergraduate scholarships or a specific lab at a specific department. The endowment isn't a slush fund.
It's also worth noting that the structural costs of research are far larger than what any single institution would be able to shoulder. For instance, MIT has extremely limited supercomputing resources under their own maintenance. Researchers would typically use such resources from centralized places funded by the NSF or DOE, where larger pools of money can be assembled.
And of course this doesn't even get into the reality that the annual operating costs of somewhere like MIT likely far exceeds the investment returns generated by the endowment.
You might as well argue that companies should never take venture capital - e.g. if they can't finance their growth through profits alone then they shouldn't raise any money. The whole point of grants or investment is to subsidize and incentive work which has payoffs on much longer timescales than what market dynamics can sustain alone.